Skip to content

Latest commit

 

History

History
73 lines (48 loc) · 1.41 KB

README.md

File metadata and controls

73 lines (48 loc) · 1.41 KB

Simple FastAPI with VercelKV Storage

Simple FastAPI with VercelKV Storage is a boilerplate for create fast api backend server with storage free by using Vercel

Installation

Local Test

To Connect your vercel KV Storage, need to set endpoint and api key variables on .env file

cp .env.sample .env
vim .env

Vercel Depoly

Configure Project

  1. Clone this repository and push.

  2. In Vercel, Create -> Project -> select cloned repository

  3. Input the Environment Variables. If you write env files above, just copy and paste.

  4. Deploy!

Usage

Test the deploy.

curl --request GET \
  --url https://{your_vercel_project}.vercel.app/health

Serving static files.

curl --request GET \
  --url https://{your_vercel_project}.vercel.app/public/simple-static-file.png

Writing a post.

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"
}'

Retriving post.

curl --request GET \
  --url https://{your_vercel_project}.vercel.app/posts/1

Contributing

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.

License

MIT