-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
44 lines (31 loc) · 772 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
41
42
43
/*
* Title: Umega
* Description: a url monitoring application
* Author: Helal Hafiz
* Date: 7/4/2021
*/
// Dependencies
const http = require('http')
const {handleReqRes} = require('./helpers/reqres')
const environment = require('./helpers/config')
const data = require('./lib/data')
const os = require('os')
// App object - module scaffolding
const app = {};
// App Configuration
app.config = {
port:3000
}
// @TODO: it will be deleted (testing)
console.log(os)
// Create Server
app.createServer = ()=>{
const server = http.createServer(app.handleReqRes)
server.listen(app.config.port,()=>{
console.log(`Server Listening on Port ${app.config.port}`)
})
}
//Handle Req and Response
app.handleReqRes = handleReqRes
//Start Server
app.createServer()