Include express package. Server serving files and later fetch from mongo.

This commit is contained in:
2020-06-07 16:33:18 +02:00
parent 61d98cd420
commit 39ecbb117b
2 changed files with 43 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
"start": "node src/index.js"
},
"dependencies": {
"express": "^4.17.1",
"nodemailer": "^6.4.6",
"puppeteer": "^3.0.4"
}

42
server.js Normal file
View File

@@ -0,0 +1,42 @@
const express = require('express')
const app = express()
const path = require('path')
const indexPage = path.join(__dirname + '/templates/index.html')
app.get('/', (req, res) => res.sendFile(indexPage));
app.listen(3000)
/*
GET
/address
Scrape the address that the url is linked to.
- check if we have it in db first.
/history
Column data: Datetime | Reason | Duration
/history/:date
Get information for given date.
Then also get pdf file to frontend.
/uptime
Data graph for w/ red and green interval bars
PAGES
/index.html
What address is being monitored
Bar graph of time intervals w/ green and red indication of downtime.
(date below)
Activity log
/incident/:date
*/