Simple FastAPI with VercelKV Storage is a boilerplate for create fast api backend server with storage free by using Vercel
To Connect your vercel KV Storage, need to set endpoint and api key variables on .env file
cp .env.sample .env
vim .env
-
Clone this repository and push.
-
In Vercel, Create -> Project -> select cloned repository
-
Input the Environment Variables. If you write env files above, just copy and paste.
-
Deploy!
curl --request GET \
--url https://{your_vercel_project}.vercel.app/health
curl --request GET \
--url https://{your_vercel_project}.vercel.app/public/simple-static-file.png
curl --request POST \
--url https://{your_vercel_project}.vercel.app/posts/1 \
--header 'Content-Type: application/json' \
--data '{
"title": "the first post",
"content": "hello world",
"writer": "Matt"
}'
curl --request GET \
--url https://{your_vercel_project}.vercel.app/posts/1
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.