-
Notifications
You must be signed in to change notification settings - Fork 0
/
apps.js
30 lines (24 loc) · 778 Bytes
/
apps.js
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
const express = require('express');
let port = process.env.PORT || 3000
const {userRoutes} = require('./src/users/user.routes');
const db = require("./db/connection");
const app = express();
mongoose = require("mongoose");
const bodyParser = require('body-parser');
app.use(express.json({limit: '500mb'}));
app.use('/uploads', express.static('uploads'));
app.use(bodyParser.urlencoded({limit: '500mb',extended:false}));
//app.use(express.json());
const fs = require('fs-extra')
//routes
userRoutes(app);
app.get("/", (req, res) => res.send("test api"));
app.listen(port, ()=> {
console.log(`listening on *:${port}`);
});
db.establishConnection();
app._router.stack.forEach(function (r) {
if (r.route && r.route.path) {
console.log(r.route.path);
}
});