-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
47 lines (37 loc) · 1.26 KB
/
server.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
'use strict'
var path = require('path');
var express = require('express');
var http = require('http');
// var livereload = require('livereload');
// var connectLivereload = require("connect-livereload");
// const config = require('dotenv').config();
var templatesPath = path.join(__dirname, 'src/main/resources/templates');
var bundlePath = path.join(__dirname, 'src/main/resources/static');
var port = process.env.PORT || 3000;
/*****************************************
*
* @type {*|app|app}
****************************************/
// var lrserver = livereload.createServer();
// lrserver.watch(bundlePath);
/***************************************
* @type {app}
***************************************/
var app = express();
app.use(express.static(bundlePath));
app.use(express.static(templatesPath));
// app.use(connectLivereload());
/****************************************
* setup node server
****************************************/
var server = http.createServer(app);
server.listen(port, () => {
console.log("templatesPath: "+ templatesPath);
console.log("bundlePath: "+ bundlePath);
console.log("Server is up on port "+ port);
});
// lrserver.server.once("connection", () => {
// setTimeout(() => {
// liveReloadServer.refresh("/");
// }, 100);
// });