-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
42 lines (30 loc) · 774 Bytes
/
Copy pathapp.js
File metadata and controls
42 lines (30 loc) · 774 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const moment = require('moment');
const express = require('express');
var app = express();
var rightMeow = moment().format();
// Make sure moment is working!!
console.log("The current time: " + rightMeow + "\nWe're getting ready for take off!");
/*
*/
var parkingObject = {
RFID:22123,
status: "Occupied",
timestamp: null
};
// For time generation, on the parking spot conditions
/*
var holder = 0;
while(holder < 58){
someSecond = moment().format('s');
console.log(someSecond);
holder++;
console.log('Holder: ' + holder);
}
*/
app.get('/', (req, res) => {
parkingObject.timestamp = moment().format('s');
res.send(parkingObject);
});
app.listen(3000, function () {
console.log('Listening on http://localhost:3000');
});