From e9fd60e61991b8513cb491f6b5fb642088073147 Mon Sep 17 00:00:00 2001
From: Anthony Correa
Date: Fri, 24 May 2024 13:40:42 -0500
Subject: [PATCH 1/2] 404 fix
---
src/app.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/app.js b/src/app.js
index 46511c1..fa83504 100644
--- a/src/app.js
+++ b/src/app.js
@@ -63,6 +63,7 @@ app.locals.pluralize = require("pluralize");
if (process.env.NODE_ENV === "development") {
var connectLiveReload = require("connect-livereload");
+ app.use("/scss", express.static(path.join(__dirname, "scss")));
app.use(connectLiveReload());
}
@@ -172,7 +173,8 @@ app.use(function (err, req, res, next) {
// catch 404 and forward to error handler
app.use(function (req, res, next) {
- next(createError(404));
+ // next(createError(404));
+ res.status(404).send('not found')
});
module.exports = {app};
\ No newline at end of file
From 49864874fc28f4b202e86f61581825542ebe1679 Mon Sep 17 00:00:00 2001
From: Anthony Correa
Date: Fri, 24 May 2024 13:40:59 -0500
Subject: [PATCH 2/2] dev script updates for scss watch
---
.vscode/launch.json | 23 ++++++++++++++++++++---
.vscode/tasks.json | 16 ++++++++++------
package.json | 6 +++---
3 files changed, 33 insertions(+), 12 deletions(-)
diff --git a/.vscode/launch.json b/.vscode/launch.json
index d558314..8a44977 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -7,7 +7,7 @@
{
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
- "name": "nodemon",
+ "name": "nodemon (dev)",
"program": "dev",
"request": "launch",
"restart": true,
@@ -17,7 +17,24 @@
],
"type": "node",
"env": {"NODE_ENV": "development"},
- "preLaunchTask": "npm: scss"
- }
+ "preLaunchTask": "npm: build-css"
+ },
+ {
+ "console": "integratedTerminal",
+ "internalConsoleOptions": "neverOpen",
+ "name": "nodemon (with scss watch)",
+ "program": "dev (with scss watch)",
+ "request": "launch",
+ "restart": true,
+ "runtimeExecutable": "nodemon",
+ "runtimeArgs": ["-e", "js,scss"],
+ "skipFiles": [
+ "/**"
+ ],
+ "type": "node",
+ "env": {"NODE_ENV": "development"},
+ "preLaunchTask": "npm: build-css"
+ },
+
]
}
\ No newline at end of file
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 51203ad..5ba5947 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -3,17 +3,21 @@
"tasks": [
{
"type": "npm",
- "script": "scss",
+ "script": "watch-scss",
"problemMatcher": [],
- "label": "npm: scss watch",
- "detail": "sass --watch src/scss/application.scss public/css/application.css src/scss/eventsheet.scss:public/css/eventsheet.css"
+ "label": "npm: watch-scss",
+ "detail": "npm run watch-css",
+ "icon": {
+ "id": "eye",
+ "color": "terminal.ansiBlue"
+ }
},
{
"type": "npm",
- "script": "scss",
+ "script": "build-css",
"problemMatcher": [],
- "label": "npm: scss",
- "detail": "sass src/scss/application.scss:public/css/application.css src/scss/eventsheet.scss:public/css/eventsheet.css"
+ "label": "npm: build-css",
+ "detail": "npm build-css"
}
]
}
\ No newline at end of file
diff --git a/package.json b/package.json
index 66ef4a6..0328e2d 100644
--- a/package.json
+++ b/package.json
@@ -24,9 +24,9 @@
},
"scripts": {
"start": "node ./bin/www",
- "dev": "nodemon . & npm run scss",
- "scss": "sass src/scss/application.scss:src/public/css/application.css src/scss/eventsheet.scss:src/public/css/eventsheet.css",
- "scss watch": "sass --watch src/scss/application.scss:src/public/css/application.css src/scss/eventsheet.scss:src/public/css/eventsheet.css"
+ "dev": "nodemon .",
+ "build-css": "sass src/scss:src/public/css",
+ "watch-scss": "nodemon -e scss -x \"npm run build-css\""
},
"dependencies": {
"@teamsnap/teamsnap-ui": "^3.12.3",