mirror of
https://github.com/KevinMidboe/ISPDowntimeMonitor.git
synced 2025-10-29 17:50:12 +00:00
Include express package. Server serving files and later fetch from mongo.
This commit is contained in:
@@ -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
42
server.js
Normal 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
|
||||
|
||||
*/
|
||||
Reference in New Issue
Block a user