forked from booleanhunter/ReactJS-AdminLTE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
executable file
·43 lines (33 loc) · 1.22 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
var http = require("http"); //1
var url = require("url"); //2
var express = require("express");
var consolidate = require('consolidate');
var handlebars = require('handlebars');
var bodyParser = require('body-parser');
var routes = require('./routes');
var app = express();
app.set('views', 'views'); //Set the folder-name from where you serve the html page. ]
app.set('view engine', 'html');
app.engine('html', consolidate.handlebars);
app.use(express.static('./public')); //Set the folder from where you serve all static files like images, css, javascripts, libraries etc
app.use(bodyParser.urlencoded({ extended: true }));
var portNumber = process.argv[2] || 8000;
http.createServer(app).listen(portNumber, function(){
console.log('Server listening at port '+ portNumber);
routes.initialize(app);
});
// var webpack = require('webpack');
// var WebpackDevServer = require('webpack-dev-server');
// var config = require('./webpack.config');
// new WebpackDevServer(webpack(config), {
// publicPath: config.output.publicPath,
// hot: true,
// historyApiFallback: true
// }).listen(3000, 'localhost', function (err, result) {
// if (err) {
// console.log(err);
// }
// console.log('Listening at localhost:3000');
// });
/*
*/