-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from FAC-Sixteen/feature/serversetup
server setup relates#41
- Loading branch information
Showing
10 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
0 info it worked if it ends with ok | ||
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ] | ||
2 info using [email protected] | ||
3 info using [email protected] | ||
4 verbose run-script [ 'prestart', 'start', 'poststart' ] | ||
5 info lifecycle [email protected]~prestart: [email protected] | ||
6 silly lifecycle [email protected]~prestart: no script for prestart, continuing | ||
7 info lifecycle [email protected]~start: [email protected] | ||
8 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true | ||
9 verbose lifecycle [email protected]~start: PATH: /usr/share/npm/bin/node-gyp-bin:/home/banna/Documents/GymBuddy/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games | ||
10 verbose lifecycle [email protected]~start: CWD: /home/banna/Documents/GymBuddy | ||
11 silly lifecycle [email protected]~start: Args: [ '-c', 'node src/index.js' ] | ||
12 silly lifecycle [email protected]~start: Returned: code: 1 signal: null | ||
13 info lifecycle [email protected]~start: Failed to exec start script | ||
14 verbose stack Error: [email protected] start: `node src/index.js` | ||
14 verbose stack Exit status 1 | ||
14 verbose stack at EventEmitter.<anonymous> (/usr/share/npm/lib/utils/lifecycle.js:232:16) | ||
14 verbose stack at emitTwo (events.js:126:13) | ||
14 verbose stack at EventEmitter.emit (events.js:214:7) | ||
14 verbose stack at ChildProcess.<anonymous> (/usr/share/npm/lib/utils/spawn.js:24:14) | ||
14 verbose stack at emitTwo (events.js:126:13) | ||
14 verbose stack at ChildProcess.emit (events.js:214:7) | ||
14 verbose stack at maybeClose (internal/child_process.js:925:16) | ||
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) | ||
15 verbose pkgid [email protected] | ||
16 verbose cwd /home/banna/Documents/GymBuddy | ||
17 error Linux 4.15.0-20-generic | ||
18 error argv "/usr/bin/node" "/usr/bin/npm" "start" | ||
19 error node v8.10.0 | ||
20 error npm v3.5.2 | ||
21 error code ELIFECYCLE | ||
22 error [email protected] start: `node src/index.js` | ||
22 error Exit status 1 | ||
23 error Failed at the [email protected] start script 'node src/index.js'. | ||
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 gymbuddy package, | ||
23 error not with npm itself. | ||
23 error Tell the author that this fails on your system: | ||
23 error node src/index.js | ||
23 error You can get information on how to open an issue for this project with: | ||
23 error npm bugs gymbuddy | ||
23 error Or if that isn't available, you can get their info via: | ||
23 error npm owner ls gymbuddy | ||
23 error There is likely additional logging output above. | ||
24 verbose exit [ 1, true ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>404 page not found </h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>server error 500</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const express = require('express'); | ||
const controllers = require('./controller/index'); | ||
|
||
const app = express(); | ||
|
||
app.set('port', process.env.PORT || 3000); | ||
app.use(controllers); | ||
|
||
module.exports = app; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const path = require('path'); | ||
|
||
exports.client = (req, res) => { | ||
res | ||
.status(404) | ||
.sendFile(path.join(__dirname, '..', '..', 'public', '404.html')); | ||
}; | ||
|
||
exports.server = (err, req, res, next) => { | ||
console.log(err.message); | ||
res | ||
.status(500) | ||
.sendFile(path.join(__dirname, '..', '..', 'public', '500.html')) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const express = require('express'); | ||
const router = express.Router(); | ||
const error = require('./error'); | ||
|
||
router.get('/', (req, res) => { | ||
res.send('Hello World') | ||
}) | ||
|
||
router.use(error.client); | ||
router.use(error.server); | ||
|
||
module.exports = router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const app = require('./app'); | ||
|
||
app.listen(app.get('port'), () => { | ||
console.log('app is running on port', app.get('port')); | ||
}) |