Open harsimrat99 opened 1 year ago
Install db-migrate: npm i db-migrate
Command to create a migration:
Run this command at the root of your directory. db-migrate create functions-table --config .\database\database.json
After modifying your newly created migration, execute the following command in the terminal: db-migrate up --config database/database.json
Example of a migration file with autoincrements and primary keys and timestamps.
We want to create a route that allows users to submit their functions to the Serverless Functions application.
Expected Behavior
The user should be able to paste, or type, their code into the webpage and press the submit button to submit their code to the database.
Possible Implementation
An express POST route is create to allow users to submit their code in a form element. The backend server will save that code into the database.
Detailed Steps For Implementation
(Noa, Sophia, Sasha)
1.5. Create a frontend EJS page that allows the user to enter their data.
Create a POST route called '/submit' that stores the user's funciton into the database. Create a frontend form that allows the user to enter their function, choose the trigger type and the language. (In this case, there is going to be a text box, radio buttons for language, radio button for trigger type)
Save that data, i.e. the function body, the langauge, the trigger type, into the database. (Need to use SQL in this step)
Return a message indicating to the user that the step was completed succesfully or unsucessfuly.