Added nodemon to automatically reload the site with new changes for development

This commit is contained in:
Gregory Ballantine 2022-02-19 01:13:53 -05:00
parent 94b5e58a62
commit ceb27ca327
5 changed files with 1797 additions and 0 deletions

3
bin/docker-watch.sh Normal file
View 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

View File

@ -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
View File

@ -0,0 +1,4 @@
{
"verbose": true,
"ignore": ["*.test.js", "fixtures/*"]
}

1781
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -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"
} }
} }