-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (22 loc) · 650 Bytes
/
index.js
File metadata and controls
30 lines (22 loc) · 650 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
'use strict';
// Create a server with a host and port
const sequelize = require('./lib/infrastructure/database/sequelize');
const createServer = require('./lib/infrastructure/webserver/server');
// Start the server
const start = async () => {
try {
await sequelize.sync();
console.log('Connection to DB has been established successfully.');
} catch (err) {
console.error('Unable to connect to the database:', err);
}
try {
const server = await createServer();
await server.start();
console.log('Server running at:', server.info.uri);
} catch (err) {
console.log(err);
process.exit(1);
}
};
start();