-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.js
More file actions
41 lines (31 loc) · 944 Bytes
/
server.js
File metadata and controls
41 lines (31 loc) · 944 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
/*
This script was made by Phillip Ochola under Buildlab
*/
var express = require('express'),
noble = require('noble'),
path = require('path'),
httpsPort = 8082,
app = express(),
RSSI_THRESHOLD = -90,
EXIT_GRACE_PERIOD = 2000; // milliseconds
// Set up express environment
express.static.mime.default_type = "text/html";
app.use(express.static(path.join(__dirname, '/static')));
// Get method template... used for basic routing
app.get('/', function (req, res) {
res.send('GET request to the homepage');
});
// POST method template .. used for database access
// Supports larger info flows
app.post('/', function (req, res) {
res.send('POST request to the homepage');
});
//Get
app.get('/', function (req, res) {
res.send('GET request to the homepage');
});//Load chang
//Database Access Routing
// Start listening on the port
app.listen(httpsPort, function() {
console.log('HTTPS Server: http://localhost:'+ httpsPort);
})