Added nodemon to automatically reload the site with new changes for development
This commit is contained in:
parent
94b5e58a62
commit
ceb27ca327
3
bin/docker-watch.sh
Normal file
3
bin/docker-watch.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
docker run --rm -w /usr/src/app -v "$PWD":/usr/src/app -p 3000:3000 -d --name bitgoblin node:lts npm run watch
|
5
index.js
5
index.js
@ -26,6 +26,11 @@ app.get('/', (req, res) => {
|
|||||||
res.render('index');
|
res.render('index');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Test GET route
|
||||||
|
app.get('/test', (req, res) => {
|
||||||
|
res.send('This is a test.');
|
||||||
|
});
|
||||||
|
|
||||||
// start Express app
|
// start Express app
|
||||||
app.listen(port, () => {
|
app.listen(port, () => {
|
||||||
console.log(`The Bit Goblin website is listening on port ${port}`);
|
console.log(`The Bit Goblin website is listening on port ${port}`);
|
||||||
|
4
nodemon.json
Normal file
4
nodemon.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"verbose": true,
|
||||||
|
"ignore": ["*.test.js", "fixtures/*"]
|
||||||
|
}
|
1781
package-lock.json
generated
1781
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -4,6 +4,7 @@
|
|||||||
"description": "The Bit Goblin official website",
|
"description": "The Bit Goblin official website",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"watch": "nodemon index.js",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
@ -16,5 +17,8 @@
|
|||||||
"express": "^4.17.3",
|
"express": "^4.17.3",
|
||||||
"node-sass-middleware": "^1.0.1",
|
"node-sass-middleware": "^1.0.1",
|
||||||
"pug": "^3.0.2"
|
"pug": "^3.0.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"nodemon": "^2.0.15"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user