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

Annotation of /trunk/src/server.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 15 - (hide annotations)
Mon Jul 29 17:28:13 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: text/javascript
File size: 502 byte(s)
Typo fixup
1 rakin 10 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 rakin 15 app.get('/', (req, res) => res.send('Bot is running...'));
13    
14 rakin 10 if (fs.existsSync(path.join(__dirname, '..', 'routes', 'api.js'))) {
15     const router = require('../routes/api');
16     app.use('/api', router);
17     }
18    
19     module.exports = () => app.listen(4000, () => {
20     console.log("Server listening at port 4000");
21     });

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26