diff --git a/inc/fftcgrouter.coffee b/inc/fftcgrouter.coffee index d068c57..574027f 100644 --- a/inc/fftcgrouter.coffee +++ b/inc/fftcgrouter.coffee @@ -61,8 +61,9 @@ FFTCGROUTER.post '/login', (req, res) -> # Templates FFTCGROUTER.get '/:template.html', (req, res) -> + # redirect logged-in users to user cp if req.session.user and req.params.template == 'index' - return res.redirect '/game.html' + return res.redirect '/usercp.html' # render requested template diff --git a/src/usercp.coffee b/src/usercp.coffee new file mode 100644 index 0000000..04ae91f --- /dev/null +++ b/src/usercp.coffee @@ -0,0 +1,10 @@ +# libs +window.$ = require('jquery') + +# import bootstrap +require './style/custom.scss' +require 'bootstrap/js/dist/alert' + +# on load +$ -> + return diff --git a/views/usercp.pug b/views/usercp.pug new file mode 100644 index 0000000..8eb8ae5 --- /dev/null +++ b/views/usercp.pug @@ -0,0 +1,6 @@ +doctype html +html + head + title Crafty Things + script(src='/usercp.bundle.js') + body diff --git a/webpack.config.js b/webpack.config.js index 25512da..eb231c3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,8 +4,9 @@ module.exports = { mode: 'development', entry: { - index: './src/index.coffee', - game: './src/game.coffee' + index: './src/index.coffee', + game: './src/game.coffee', + usercp: './src/usercp.coffee' }, devtool: 'inline-source-map',