|
|
|
|
|
|
|
|
const path = require('path') |
|
|
const path = require('path') |
|
|
const port = process.env.PORT || 3000 |
|
|
const port = process.env.PORT || 3000 |
|
|
require('./database/mongoose') |
|
|
require('./database/mongoose') |
|
|
|
|
|
|
|
|
|
|
|
const userRouter = require('./routers/user') |
|
|
//const viewsPath = path.join(__dirname, '../templates/views') |
|
|
//const viewsPath = path.join(__dirname, '../templates/views') |
|
|
|
|
|
|
|
|
app.use(express.json()) |
|
|
app.use(express.json()) |
|
|
|
|
|
|
|
|
|
|
|
app.use(userRouter) |
|
|
|
|
|
|
|
|
app.get('/', (req, res) => { |
|
|
app.get('/', (req, res) => { |
|
|
try { |
|
|
try { |