-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
58 lines (48 loc) · 1.43 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
const express = require('express'),
app = express(),
mysql = require('mysql2'), // import mysql module
cors = require('cors'),
bodyParser = require('body-parser');
const fs = require('fs');
const path = require('path');
const axios = require('axios');
// use the modules
app.use(cors())
app.use(bodyParser.json());
// make server object that contain port property and the value for our server.
const server = {
port: process.env.PORT || 5000
};
const usersRouter = require('./routes/users');
const policeRouter = require('./routes/police');
const webhookRouter = require('./routes/webhook');
const testesRouter = require('./routes/testes');
const discordRouter = require('./routes/discord');
const conceRouter = require('./routes/conce');
app.use('/users', usersRouter);
app.use('/police', policeRouter);
app.use('/webhook', webhookRouter);
app.use('/testes', testesRouter)
app.use('/discord', discordRouter)
app.use('/conce', conceRouter)
// starting the server
app.listen(server.port, () => console.log(`Server started, listening port: ${server.port}`));
// setup database
db = mysql.createConnection({
host: '127.0.0.1,
user: 'root',
password: '',
database: 'vrp'
})
//db2 = mysql.createConnection({
// host: '127.0.0.1',
// user: 'root',
// password: '',
// database: 'wordpress'
//})
db3 = mysql.createConnection({
host: '127.0.0.1',
user: 'root',
password: '',
database: 'vegas'
})