-
-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathserver.js
More file actions
27 lines (23 loc) · 742 Bytes
/
server.js
File metadata and controls
27 lines (23 loc) · 742 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
const mongoose = require("mongoose");
require("dotenv").config();
const app = require("./server_app/app");
const config = require("./server_app/helpers/config");
const { Port, MongoUrl, ApiUrl, IsDevelopment } = config;
mongoose.connect(
MongoUrl,
{ useNewUrlParser: true, useUnifiedTopology: true },
function (err) {
if (err) throw err;
const databaseInfo = IsDevelopment ? `Database: ${MongoUrl}\n` : "";
app.listen(Port, function () {
console.log(`
---------------------------------------------------
--------------- APPLICATION RUNNING ---------------
---------------------------------------------------
App: ${ApiUrl}
${databaseInfo}
---------------------------------------------------
`);
});
}
);