Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.ts
More file actions
Latest commit
48 lines (41 loc) · 906 Bytes
/
Copy pathserver.ts
File metadata and controls
48 lines (41 loc) · 906 Bytes
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
/**
* Required external modules
*/
importexpress,{Application}from'express';
importpathfrom'path';
/**
* Required internal modules
*/
import{info}from'./logmanager';
import{DBManager}from'./dbmanager';
import{loadRoutes}from'./routemanager';
/**
* Required configuration sections
*/
import{website_port}from'./config.json';
/**
* App Variables
*/
constapp: Application=express();
/**
* SQL Connection.
*/
constdb: DBManager=newDBManager();
db.createTables();
/**
* App Configuration
*/
app.use(express.json());
app.set('views',path.join(path.join(__dirname,'views'),'frontend'));
app.set('view engine','pug');
app.use(express.static(path.join(__dirname,'public')));
/**
* Routes Definitions
*/
loadRoutes(app,db);
/**
* Server Activation
*/
app.listen(website_port,()=>{
info(`Listening to requests at 127.0.0.1:${website_port}`);
});