gbowne1 / RadioLogger

A Radio Logging application build with NodeJS and ExpressJS
GNU General Public License v3.0
6 stars 6 forks source link

Add a bash start script #58

Open gbowne1 opened 1 year ago

gbowne1 commented 1 year ago

this would be the contents of the file

#!/bin/bash

# Start mongod
mongod &

# Change to server directory and start server.js
cd src/server
node server.js & index.js

# Change to client directory and start index.js
cd ../client
node index.js & app.js

the user would have to chmod +x start.sh and run it with ./start.sh

jzunigarce commented 1 year ago

I don't see the index.js file on the server, however the app.js file exists but it doesn't do anything or return. If you want to use it, you can separate the server from the application (express), otherwise we could remove it

gbowne1 commented 1 year ago

Both the server and the client can have a separate app.js, aside from both also having index.js and server.js.

app.js on the server side is basically a controller for the server.js and the servers global index.js file.

Our current nodemon setup picks up index.js and server.js when it starts. It can also watch the client side index.js and app.js at the same time (thats what create react app's nodemon does) just requires a different setup.

Server side and client side app.js can hook up to the html files as script tags. The app.js isnt returning anything as it is a quiet script in the background loaded in a few of the html files the same as index.js. its incomplete right now but they work.