nodemon deploy
This commit is contained in:
parent
947790c55a
commit
30de3b4497
2 changed files with 4 additions and 2 deletions
|
@ -13,7 +13,7 @@
|
|||
"build": "webpack",
|
||||
"watch": "webpack --watch",
|
||||
"start": "webpack && coffee server.coffee",
|
||||
"debug": "webpack --watch & coffee server.coffee",
|
||||
"debug": "webpack --watch & nodemon server.coffee",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
|||
"sass-loader": "^7.1.0",
|
||||
"style-loader": "^0.23.1",
|
||||
|
||||
"nodemon": "^1.18.9",
|
||||
"webpack": "^4.25.1",
|
||||
"webpack-cli": "^3.1.2",
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ app.post '/login', (req, res) ->
|
|||
fftcgdb.login req.body.login, req.body.password
|
||||
.then (userid) ->
|
||||
req.session.userID = userid
|
||||
req.session.userLogin = req.body.login
|
||||
req.session.save()
|
||||
console.log "logged in '#{req.body.login}'"
|
||||
res.json
|
||||
|
@ -61,7 +62,7 @@ app.use express.static path.resolve(__dirname, 'public_html')
|
|||
app.set 'view engine', 'pug'
|
||||
app.get '/:template.html', (req, res) ->
|
||||
if req.session
|
||||
console.log "logged in as '#{req.session.userID}'"
|
||||
console.log "logged in as '#{req.session.userLogin}'"
|
||||
res.render (req.params.template + '.pug')
|
||||
|
||||
# Create server
|
||||
|
|
Reference in a new issue