forked from TooeleTechSoftDev/PizzaTime-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index2.js
28 lines (22 loc) · 818 Bytes
/
index2.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
const express = require('express')
const app = express()
const bodyParser = require('body-parser')
const cors = require('cors')
//var fs = require('fs')
//var path = require('path')
var http = require('http').Server(app)
const errorHandler = require('./helpers/error-handler')
const jwt = require('./helpers/jwt')
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())
app.use(cors())
//app.use(jwt())
//app.use('/acct', require('./accounts/accounts.controller'))
//app.use('/ord', require('./orders/orders.controller'))
app.use('/prod', require('./products/products.controller'))
//app.use('/pg', require('./pages/pages.controller'))
// Global error handler
app.use(errorHandler)
// Turn up web server
const port = 3000
http.listen(port, () => { console.log("Listening on port ",port)})