npm install
node index.js
- start requesting pages. To change the port number go into ./index.js
http://localhost:3030/
npm install
- Download MySQL Workbench.
- Install MySQL Workbench.
- Create a new database, local instance.
- Create a new user, local instance.
- Create a new schemas named "mydb"
Assumption for the prisma commands: prisma installed globally.
prisma init
- Applying prisma schema to the MySQL localhost with
prisma migrate dev
& name the migration accordingwhen updating the schema use
prisma db push
- To generate all the data for the server run the ./mockdata/mockdatagen.py this will do all the nessary POST requests & check or error.
In python terminal it's normal for half of the test cases to be red. However, the TOP one should always be green. if not drop the MySQL Schema and create a new to reset the AutoIncrement ID.
- Done. All data are in place for querying.
npm run dev
- start requesting pages. To change the port number go into ./src/app.ts
http://localhost:8080/
npm install
you may need to install dependancies
To run the localhost server,
change directory to the root of the project and run:
run the following command:
npm start
This will create a .js project and and run the app.ts file.
By default, the app.ts file will run on port 8080.
main file: src/app.ts
run the following command:
pull the schema from the database in .prisma
prisma db pull
prisma the client again for the updated schema. Do this everytime the schema is updated.
prisma generate
Use Insomnia software to HTTP request
http://localhost:8080/
http://localhost:8080/banks
http://localhost:8080/payment-method