Routes can be created automatically based off your folder structure. This is the fastest and easiest way of getting started, and is probably enough for the majority of projects.
Creating Routes Automatically:
In your project folder, create a subfolder for each route, and inside that subfolder, create an index.js file.
For example:
- /MyProject/helloworld/index.js
- /MyProject/downloadjobs/index.js
- /MyProject/savejobs/index.js
Note: each route, or subfolder, must have an index.js file, and you can include other scripts files as needed
Accessing Routes:
Once you have created your projects, your routes become the path in your URL.
So for example, if your scope is "company-project.api.blinkm.io", then your routes are accessed like:
- https://company-project-dev.api.blinkm.io/helloworld/
- https://company-project-dev.api.blinkm.io/downloadjobs/
- https://company-project-dev.api.blinkm.io/savejobs/
Examples:
If you haven't yet created any routes for your project, you can quickly get started by downloading the examples ZIP from the Server CLI Examples and Tips page.