-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.js
33 lines (27 loc) · 1.14 KB
/
routes.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
"use strict";
const express = require("express");
const router = express.Router();
const station = require('./controllers/station.js');
const accounts = require('./controllers/accounts.js');
const dashboard = require("./controllers/dashboard.js");
const about = require("./controllers/about.js");
// Accounts
router.get('/', accounts.index);
router.get('/account', accounts.accountdetails);
router.post('/update/:id', accounts.updatedetails);
router.get('/login', accounts.login);
router.get('/signup', accounts.signup);
router.get('/logout', accounts.logout);
router.post('/register', accounts.register);
router.post('/authenticate', accounts.authenticate);
// Home page
router.get('/about', about.index);
router.get('/dashboard', dashboard.index);
router.get('/dashboard/deletestation/:id', dashboard.deleteStation);
router.post('/dashboard/addstation', dashboard.addStation);
// Stations
router.get('/station/:id', station.index);
router.get('/station/:id/deletereading/:readingid', station.deleteReading);
router.post('/station/:id/addreading', station.addReading);
router.post('/station/:id/generateReading', station.generateReading);
module.exports = router;