-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
44 lines (37 loc) · 1.04 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
36
37
38
39
40
41
42
43
44
import express from 'express'
import bodyParser from 'body-parser'
import compression from 'compression'
import http from 'http'
import path from 'path'
import morgan from 'morgan'
import JiraClient from 'jira-connector'
import routes from './routes'
import credentials from './credentials.json'
import atlassianConnect from './atlassian-connect'
import ReactViews from 'express-react-views'
const app = express()
const jira = new JiraClient({
host: credentials["jiraHost"],
basic_auth: {
username: credentials["username"],
password: credentials["password"]
}
})
app.use((req,res,next) => {
req.jira = jira
req.atlassianconnect = atlassianConnect
next()
})
const port = 3000
app.set('port', port)
app.use(morgan('common'))
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: false }))
app.use(compression())
app.set('views', __dirname + '/views')
app.set('view engine', 'jsx')
app.engine('jsx', ReactViews.createEngine())
routes(app)
http.createServer(app).listen(port, () => {
console.log('App server running')
});