-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
40 lines (30 loc) · 872 Bytes
/
app.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
const express = require('express');
const path = require('path');
const app = express();
const mssql = require('mssql');
// change timeout to 10 minutes
const config = {
"user": 'sa',
"password": 'iamehmetozdemir',
"server": 'IAMEHMETOZDEMIR\\SQLEXPRESS',
"database": 'Formula',
"port": 1433,
"dialect": "mssql",
"dialectOptions": {
"instanceName": "SQLEXPRESS"
},
"options": {
"trustServerCertificate": true,
}
};
mssql.connect(config, function (err) {
if (err) console.log(err);
else console.log('Connected to SQL Server');
});
app.use('/constructor', require('./Routers/Constructor'));
app.use('/driver', require('./Routers/Driver'));
app.use('/race', require('./Routers/Race'));
app.use('/season', require('./Routers/Season'));
app.listen(3000, () => {
console.log('Server started on http://localhost:3000');
});