-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3b0c20
commit c8f0e01
Showing
3 changed files
with
5,339 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
const express = require('express') | ||
const morgan = require('morgan') | ||
const express = require("express"); | ||
const morgan = require("morgan"); | ||
const cors = require("cors"); | ||
|
||
const userRouter = require('./src/routes/user.router') | ||
const postRouter = require('./src/routes/post.router') | ||
const rootRouter = require('./src/routes/root.router') | ||
const healthRouter = require('./src/routes/health.router') | ||
const userRouter = require("./src/routes/user.router"); | ||
const postRouter = require("./src/routes/post.router"); | ||
const rootRouter = require("./src/routes/root.router"); | ||
const healthRouter = require("./src/routes/health.router"); | ||
|
||
const app = express() | ||
const app = express(); | ||
|
||
if (process.env.NODE_ENV == 'development') { | ||
app.use(morgan('dev')) | ||
app.use(cors()); | ||
|
||
if (process.env.NODE_ENV == "development") { | ||
app.use(morgan("dev")); | ||
} | ||
|
||
app.use(express.json()) | ||
app.use(express.json()); | ||
|
||
app.use('/health', healthRouter) | ||
app.use('/api/v1/user', userRouter) | ||
app.use('/api/v1/post', postRouter) | ||
app.use('/*', rootRouter) | ||
app.use("/health", healthRouter); | ||
app.use("/api/v1/user", userRouter); | ||
app.use("/api/v1/post", postRouter); | ||
app.use("/*", rootRouter); | ||
|
||
module.exports = app | ||
module.exports = app; |
Oops, something went wrong.