-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
33 lines (24 loc) · 768 Bytes
/
server.js
File metadata and controls
33 lines (24 loc) · 768 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
'use strict';
// Module dependencies.
var express = require('express');
var app = express();
// Express Configuration
require('./lib/config/express')(app);
// Controllers
var api = require('./lib/controllers/api'),
index = require('./lib/controllers');
// Server Routes
app.get('/api/precincts', api.precincts);
app.get('/api/precinct/:id', api.precinct);
app.get('/api/precinct-geo', api.precinctGeo);
// Angular Routes
app.get('/views/partials/*', index.partials);
app.get('/partials/*', index.partials);
app.get('/', index.index);
// Start server
var port = process.env.PORT || 3000;
app.listen(port, function () {
console.log('Express server listening on port %d in %s mode', port, app.get('env'));
});
// Expose app
exports = module.exports = app;