2 回答

TA貢獻(xiàn)1877條經(jīng)驗(yàn) 獲得超1個(gè)贊
// routes.js
import { Router } from 'express';
const Router = Router()
Router.get('/customer/:customername', getCustomerbyname)
.put('/customer/:customername', saveCustomer);
Router.post('/calculate/:id', calculate);
module.exports = router
/// in app.js or server.js or index.js
// import the router
import {router as customerRoutes} from './routes.js
// add to your app
app.use('/',customerRoutes)

TA貢獻(xiàn)1770條經(jīng)驗(yàn) 獲得超3個(gè)贊
似乎您已經(jīng)為路由設(shè)置了身份驗(yàn)證,但忘記了對(duì)其進(jìn)行身份驗(yàn)證?Middleware
可能已設(shè)置,因此也許嘗試進(jìn)行身份驗(yàn)證。
- 2 回答
- 0 關(guān)注
- 210 瀏覽
添加回答
舉報(bào)