|
|
3 år sedan | |
|---|---|---|
| .. | ||
| api | 3 år sedan | |
| .gitignore | 3 år sedan | |
| README.md | 3 år sedan | |
| package-lock.json | 3 år sedan | |
| package.json | 3 år sedan | |
| tsconfig.json | 3 år sedan | |
Backend for the mobile application.
By adding a file in the api folder, it will create an endpoint of the name of the file.
For instance, the file directions-wrapper.ts is linked to the endpoint /api/directions-wrapper.
When targeting the endpoint, the function defined in the related file will be executed.
To have a small example of a serveless function, check out directions-wrapper.ts
If you need to use secrets, define them as environment variables on the vercel site.
You have to run npm i each time the package.json is modified to install the new dependencies.
It also includes each time you pull changes from others.
npx vercel loginTo locally test the functions, run npx vercel dev.
It will start a local server that you can target for your tests.
Once authenticated, run npx vercel --prod
For the first time, you have to link to the existing project.
Set up and deploy ..., answer y (default answer)teamprojectlodz-gmailcom (default answer)Link to existing project, answer yphysigoIt will generate a .vercel folder, which links to the project on vercel.