-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (23 loc) · 895 Bytes
/
index.js
File metadata and controls
30 lines (23 loc) · 895 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
const express = require('express')
const bodyParser = require('body-parser')
const path = require('path')
const router = express.Router()
const app = express()
const port = process.env.PORT || 1337
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }))
app.use(bodyParser.text())
app.use(bodyParser.json({ type: "application/vnd.api+json" }))
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*")
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept")
next()
})
app.use(express.static(path.join(__dirname, 'public')))
app.use(express.static(path.join(__dirname, 'src')))
require('./src/routing/api')(app)
require('./src/routing/wallet')(app)
require('./src/routing/tx')(app)
app.listen(port, () => {
console.log(`App listening on port: http://localhost:${port}`)
})