Update app.sh

This commit is contained in:
colin 2023-12-27 15:00:35 +00:00
parent f3acfb9da4
commit f5ecab9c99
1 changed files with 9 additions and 10 deletions

19
app.sh
View File

@ -23,14 +23,6 @@ case "${STORAGE_TYPE}" in
;;
esac
# If TEST_MODE is true, install Mocha and run tests
if [ "$TEST_MODE" = "true" ]; then
echo "Installing Mocha for testing..."
npm install mocha
echo "Running tests..."
npm test
else
# Normal startup
# Generate config.js from environment variables
cat > config.js <<EOF
{
@ -65,6 +57,13 @@ else
}
EOF
# Start the server
# If TEST_MODE is true, install Mocha and run tests
if [ "$TEST_MODE" = "true" ]; then
echo "Installing Mocha for testing..."
npm install mocha
echo "Running tests..."
npm test
else
# Start the server for normal run
exec node server.js
fi
fi