/[sudobot]/trunk/src/server.js
ViewVC logotype

Contents of /trunk/src/server.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10 - (show annotations)
Mon Jul 29 17:28:12 2024 UTC (8 months ago) by rakin
File MIME type: text/javascript
File size: 442 byte(s)
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