host-frontend #17
2
backend/.gitignore
vendored
2
backend/.gitignore
vendored
@@ -109,4 +109,4 @@ dist
|
||||
# Stores VSCode versions used for testing VSCode extensions
|
||||
.vscode-test
|
||||
|
||||
|
||||
frontend/
|
||||
|
||||
@@ -26,6 +26,12 @@ app.all("*", function (req, res, next) {
|
||||
if (!serverStartupComplete)
|
||||
return res.send("Server is starting...");
|
||||
else return next();
|
||||
});
|
||||
|
||||
app.all("*", function (req, res, next) {
|
||||
if (!/^\/API\/.*/.test(req.url)) {
|
||||
return res.sendFile(path.join(__dirname, './frontend/index.html'));
|
||||
} else return next();
|
||||
})
|
||||
|
||||
app.get('/API/day', function (req, res) {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
BACKENDID = netstat -tulpn 2>/dev/null | grep ":3001 " | awk '{print $7;}' | cut -d "/" -f1
|
||||
kill -9 $BACKENDID
|
||||
git checkout master &&
|
||||
git pull &&
|
||||
git pull
|
||||
cd backend
|
||||
rm -r ./frontend
|
||||
mkdir frontend
|
||||
npm i
|
||||
cd ../frontend
|
||||
npm i
|
||||
npm run build
|
||||
mv ./build/*
|
||||
../backend/frontend
|
||||
mv ./build/* ../backend/frontend
|
||||
cd ../backend
|
||||
npm start
|
||||
Reference in New Issue
Block a user