Skip to content

Latest commit

 

History

History
64 lines (40 loc) · 1.83 KB

README.md

File metadata and controls

64 lines (40 loc) · 1.83 KB

vercel-go-chi

Demo application using vercel serverless functions to create a simple API with go using chi router.

About

This template uses common go api practices for developing apis for deployment on vercel. When deployed on vercel, every time the serverless function is invoked, a new router is created and the current request is matched against it.

Who this is for

If you have a small api with not a lot of traffic, this template and serverless functions in general are right for you.

Who this is not for

If you have a lot of traffic or have a lot of external dependencies (Databases, external APIs, ...) then you might use a real server.

For example if you have are connecting to a database, vvery time the serverless function is invoked, a new connection to the database will be created and destroyed afterwards. This can create a bottleneck in a high traffic environment.

Technologies used

Using this template

To use this template, you can click on the "Use this template" button or clone it using git:

git clone https://github.com/ngoldack/vercel-go-chi.git

Pre-requisites

To run this application locally, you need to have Go and Magefile installed.

If you want to run the CI locally, you also need Docker and Dagger installed.

Tasks

Dev server

mage -v dev

Test

mage -v test

CI (build, lint, test)

Requires docker and dagger installed.

dagger run go run ci/main.go