-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
30 lines (24 loc) · 802 Bytes
/
index.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
/*
* BarCode Server
*
* Patricio Díaz ([email protected])
*
*/
var express = require('express');
var bodyParser = require('body-parser');
var logger = require('morgan');
var methodOverride = require('method-override');
var path = require('path');
var routes = require('./routes/routes.js');
var app = express();
app.set('views', path.join(__dirname, 'views'));
//app.set('view engine', 'jade');
app.use('/', routes);
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(methodOverride());
app.use(express.static(path.join(__dirname, 'static')));
var server = app.listen(process.env.PORT || 3000, function() {
console.log('Barcode server listening on port %d', server.address().port);
});