-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
36 lines (29 loc) · 1.22 KB
/
app.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
var express = require('express'); // call express
var app = express(); // define our app using express
//var bodyParser = require('body-parser');
var favicon = require('serve-favicon');
app.use(favicon(__dirname + '/static/favicon.ico'));
var mongoose = require('mongoose');
var connectionString = process.env.CUSTOMCONNSTR_MONGOLAB_URI || 'mongodb://localhost/footywednesdays'
mongoose.connect(connectionString);
// configure app to use bodyParser()
// this will let us get the data from a POST
//app.use(bodyParser.urlencoded({ extended: true }));
//app.use(bodyParser.json());
// routes for our API
var defaultRouter=require('./app/routes/default');
var welcomeRouter=require('./app/routes/welcome');
var prijaveRouter=require('./app/routes/prijava');
var stalniRouter=require('./app/routes/stalni');
var nemoguRouter=require('./app/routes/nemogu');
var notifikacijaRouter=require('./app/routes/notifikacija');
// REGISTER OUR ROUTES
app.use(defaultRouter);
app.use('/api', welcomeRouter);
app.use('/api', prijaveRouter);
app.use('/api', stalniRouter);
app.use('/api', nemoguRouter);
app.use('/api', notifikacijaRouter);
// static files folder
app.use(express.static('static'));
module.exports = app;