server stuff

This commit is contained in:
2018-06-26 12:57:55 +02:00
parent 18098cb896
commit 54b077cfa7
4 changed files with 106 additions and 46 deletions

View File

@ -1,8 +1,16 @@
import * as http from 'http'
import * as express from 'express'
import * as path from 'path'
import * as morgan from 'morgan'
import * as fs from 'fs'
let app = express()
app.use('/', express.static(__dirname + '/../../dist'))
let accessLogStream = fs.createWriteStream(path.join(__dirname, '/../../../access.log'), {flags: 'a'})
app.use(morgan('combined', {stream: accessLogStream}))
app.use('/', express.static(path.join(__dirname, '/../../../dist')))
app.listen(3000, () => {
console.log('Example app listening on port 3000!')