![]() post ( '/test', ( req, res, next ) => ). Here is a starter setup for the application.įirst, require express, morgan, and body-parser:Īpp. ![]() Run the following command to set up a new project:Ĭreate a new file named app.js in your project root directory to set up the Express app: To begin, open your command line terminal and create a new project directory: You will create a REST API for this tutorial using Express to test your Joi schemas. /fees/pay: make fee payments for students./auth/edit: set login credentials for teachers.Step 1 - Setting up the Projectįor this tutorial, you will pretend that you are building a school portal and you want to create API endpoints: This tutorial was verified with Node v14.2.0, npm v6.14.5, and joi v13.0.2. Downloading and installing a tool like Postman is recommended for testing API endpoints.Follow How to Install Node.js and Create a Local Development Environment. A local development environment for Node.js. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |