Basic Setup

This commit is contained in:
Lukas Bachschwell 2017-03-12 17:27:04 +01:00
parent 8dfe458d8f
commit e9e79562e0
10 changed files with 90 additions and 43 deletions

View File

@ -3,3 +3,5 @@
This is a funny universal scoreboard originally developed for the This is a funny universal scoreboard originally developed for the
beerpong tournament at a scoutparty beerpong tournament at a scoutparty
This thing is based on Express with handlebars, socketio and some other fun

4
app.js
View File

@ -5,8 +5,7 @@ var logger = require('morgan');
var cookieParser = require('cookie-parser'); var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser'); var bodyParser = require('body-parser');
var routes = require('./routes/index'); var routes = require('./routes/routes');
var users = require('./routes/users');
var app = express(); var app = express();
@ -23,7 +22,6 @@ app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public'))); app.use(express.static(path.join(__dirname, 'public')));
app.use('/', routes); app.use('/', routes);
app.use('/users', users);
// catch 404 and forward to error handler // catch 404 and forward to error handler
app.use(function(req, res, next) { app.use(function(req, res, next) {

View File

@ -1,10 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Spielstand</title>
</head>
<body>
</body>
</html>

45
npm-debug.log Normal file
View File

@ -0,0 +1,45 @@
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm@4.1.2
3 info using node@v7.1.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle uniScore@1.0.0~prestart: uniScore@1.0.0
6 silly lifecycle uniScore@1.0.0~prestart: no script for prestart, continuing
7 info lifecycle uniScore@1.0.0~start: uniScore@1.0.0
8 verbose lifecycle uniScore@1.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle uniScore@1.0.0~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/LB/Desktop/z_Projects/uniScore/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/go/bin:/usr/local/MacGPG2/bin:/Library/TeX/texbin:/Users/LB/.rvm/bin:/Users/LB/pebble-dev/PebbleSDK-3.6/bin:/usr/local/sbin:/Users/LB/Library/Android/sdk/platform-tools:/Users/LB/.rvm/bin:/Users/LB/pebble-dev/PebbleSDK-3.6/bin:/usr/local/sbin:/Users/LB/Library/Android/sdk/platform-tools:/Users/LB/.meteor
10 verbose lifecycle uniScore@1.0.0~start: CWD: /Users/LB/Desktop/z_Projects/uniScore
11 silly lifecycle uniScore@1.0.0~start: Args: [ '-c', 'node ./bin/www' ]
12 silly lifecycle uniScore@1.0.0~start: Returned: code: 1 signal: null
13 info lifecycle uniScore@1.0.0~start: Failed to exec start script
14 verbose stack Error: uniScore@1.0.0 start: `node ./bin/www`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:885:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid uniScore@1.0.0
16 verbose cwd /Users/LB/Desktop/z_Projects/uniScore
17 error Darwin 16.4.0
18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
19 error node v7.1.0
20 error npm v4.1.2
21 error code ELIFECYCLE
22 error uniScore@1.0.0 start: `node ./bin/www`
22 error Exit status 1
23 error Failed at the uniScore@1.0.0 start script 'node ./bin/www'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the uniScore package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error node ./bin/www
23 error You can get information on how to open an issue for this project with:
23 error npm bugs uniScore
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls uniScore
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

View File

@ -1,9 +0,0 @@
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'Express' });
});
module.exports = router;

14
routes/routes.js Normal file
View File

@ -0,0 +1,14 @@
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'Muhahaha' });
});
router.get('/admin', function(req, res, next) {
//res.send('respond with a resource');
res.render('admin', { title: 'Muhahaha ADMIN' });
});
module.exports = router;

View File

@ -1,9 +0,0 @@
var express = require('express');
var router = express.Router();
/* GET users listing. */
router.get('/', function(req, res, next) {
res.send('respond with a resource');
});
module.exports = router;

14
views/admin.hbs Normal file
View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Admin Interface</title>
<link rel='stylesheet' href='/css/style.css' />
</head>
<body>
<h1>{{title}}</h1>
<p>Welcome to {{title}}</p>
</body>
</html>

View File

@ -1,2 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Spielstand</title>
<link rel='stylesheet' href='/css/style.css' />
</head>
<body>
<h1>{{title}}</h1> <h1>{{title}}</h1>
<p>Welcome to {{title}}</p> <p>Welcome to {{title}}</p>
</body>
</html>

View File

@ -1,10 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>{{title}}</title>
<link rel='stylesheet' href='/stylesheets/style.css' />
</head>
<body>
{{{body}}}
</body>
</html>