Skip to content

Latest commit

 

History

History
46 lines (37 loc) · 1.31 KB

README.md

File metadata and controls

46 lines (37 loc) · 1.31 KB

calories-app-server

1. Remove existing database(optional)

To prevent any potential error with previous records, you may want to remove the existing database(if any) in your directory:

rm -f ./calorie-db.db

2. Initialize server and database

To initialize the server and the database, user can execute the following combined command:

python3:

python3 ./server/database.py && python3 ./server/server.py

python:

python ./server/database.py && python ./server/server.py

The following code should be shown after the executions:

 * Serving Flask app 'server'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on {LocalServerIP}
 * Running on {PublicServerIP}
Press CTRL+C to quit

3. Let the application connect to the server

You should store the {PublicServerIP} to the calories-app/serverConfig.js for the item serverIP and change the serverMode to "online" to enable the connectivity between applicaiton and server.

The final version of calories-app/serverConfig.js should be as follows:

// serverConfig.js
module.exports = {
    "serverIP": "{PublicServerIP}",
    "serverMode": "online" //online OR offline
}