-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
29 lines (24 loc) · 785 Bytes
/
Copy pathserver.js
File metadata and controls
29 lines (24 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import express from 'express'
import dotenv from 'dotenv'
import helmet from 'helmet'
import morgan from 'morgan'
import bodyParser from 'body-parser'
import Configuration from './configuration/configuration.js'
import middlewares from './src/middelwares/middlewares.js'
import userRoutes from './src/routes/user.routes.js'
dotenv.config()
const app = express()
app.use(bodyParser.urlencoded({extended: true}))
app.use(bodyParser.json())
app.use(helmet())
app.use(morgan('common'))
//userRoutes.routes(app)
app.use("/users", userRoutes)
// app.use(middlewares.notFound)
// app.use(middlewares.errorHandler)
Configuration.connectToDatabase()
Configuration.connectToPort(app)
if(process.env.NODE_ENV === "production") {
}
app.use(express.static('frontend/build'))
export default app