Parent Directory
|
Revision Log
Added new features
1 | const express = require('express'); |
2 | const fs = require('fs'); |
3 | const path = require('path'); |
4 | |
5 | const app = express(); |
6 | |
7 | app.use(express.json()); |
8 | app.use(express.urlencoded({ |
9 | extended: true |
10 | })) |
11 | |
12 | if (fs.existsSync(path.join(__dirname, '..', 'routes', 'api.js'))) { |
13 | const router = require('../routes/api'); |
14 | app.use('/api', router); |
15 | } |
16 | |
17 | module.exports = () => app.listen(4000, () => { |
18 | console.log("Server listening at port 4000"); |
19 | }); |
[email protected] | ViewVC Help |
Powered by ViewVC 1.1.26 |