From 8d7b0d4628460d0b91d8996679fb1787d5187c9d Mon Sep 17 00:00:00 2001 From: Moe Date: Fri, 13 May 2022 11:58:35 +0700 Subject: [PATCH] Fix placement --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 13d3477..b2f5245 100644 --- a/index.js +++ b/index.js @@ -26,9 +26,6 @@ app.use(express.json()); app.use(express.urlencoded({ extended: false })); app.use(cookieParser()); -app.use('/', indexRouter); -app.use('/api', api); - app.use(function (req, res, next) { res.header("Access-Control-Allow-Origin", "*"); res.header("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE, HEAD"); @@ -39,6 +36,9 @@ app.use(function (req, res, next) { next(); }); +app.use('/', indexRouter); +app.use('/api', api); + app.listen(config.port, () => { console.log(`Server is running on port : ${config.port}`); });