forked from Wasakachain/Node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
28 lines (24 loc) · 834 Bytes
/
index.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
const Express = require('express');
const App = Express();
// importing routes
const node = new (require('./src/models/Node'))();
exports.node = node;
const Routes = require('./src/Routes/NodeRoutes');
const { handleNotFound, setCorsHeadersMiddleware } = require('./src/utils/functions');
const PORT = process.env.port || 5555;
exports.WASA = 1000000;
exports.AVO = 1000;
exports.GAR = 1;
App.use(Express.json());
App.use(Express.urlencoded({ extended: true }));
App.use(Express.raw());
App.use(Express.text());
// App routes
App.use(setCorsHeadersMiddleware);
App.use('/', Routes);
App.use(handleNotFound);
// turn on the server
App.listen(PORT, () => {
console.log('\x1b[36m%s\x1b[0m', `\n\nNode server is running on port ${PORT}!`);
console.log('\x1b[42m%s\x1b[0m', '\t\t\t-/-/-/-¡Enjoy WasakaChain!-/-/-/\t\t\t');
});