-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathserver.js
More file actions
26 lines (19 loc) · 726 Bytes
/
server.js
File metadata and controls
26 lines (19 loc) · 726 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
var express = require("express");
var app = express();
var bodyParser = require('body-parser');
var path = require("path");
var port = process.env.PORT || 2222;
app.listen(port);
console.log("Running on ",port);
app.engine('.html', require('ejs').__express);
app.set('view engine', 'html');
/* COMMON RESOURCES */
app.use(bodyParser.json());
app.use("/bower_components",express.static("bower_components")); // Shared libraries
app.use("/resources",express.static("resources")); // Shared resources
var signup = require("./api/signup.js");
app.use("/api",signup);
app.use("/",express.static("home")); // WebApp Frame
app.get(['/','/*','/**'],function(req,res){
res.sendFile(path.join(__dirname, '/home/index.html'));
})