-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
26 lines (22 loc) · 816 Bytes
/
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
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var index = require('./modules/routes/index');
var all = require('./modules/routes/all');
var rentals = require('./modules/routes/rentals');
var forsale = require('./modules/routes/forsale');
var addhouse = require('./modules/routes/addhouse');
var houseview = require('./modules/routes/houseview');
var path = require('path');
app.use(bodyParser.json());
app.use(express.static('public'));
app.use('/', index);
app.use('/all', all);
app.use('/rentdb', rentals);
app.use('/saledb', forsale);
app.use('/addhouse', addhouse);
app.use('/houseview', houseview);
app.get('/*', function (req, res) {
res.sendFile(path.join(__dirname, 'public/views/index.html'));
});
app.listen(process.env.PORT || 3000); // end server