This is a simple REST API to perform CRUD operations with jokes using the GO HTTP package and Firestore. The purpose is to provide a simple example of a CRUD app that uses the standard net/http
library, interacts with Firestore, and follows a common API structure.
The only prerequisite to using this example is having GO installed on your machine. A working knowledge of Firestore and REST APIs is useful, but this project has been set up to work out of the box.
- Clone the repo with
git clone https://github.com/imbradyboy/go-firestore-crud.git
- Create a new Firebase project and download a service account credential. If you've never done this before, you can find official instructions here
- Create a
.env
file in the root of your project and add the absolute path to the service account you downloaded in the step above to a variable namedFB_ADMIN_SA_LOCATION
like below
FB_ADMIN_SA_LOCATION=path/to/file.json
- Run
go mod download
to install dependencies - Open up PostMan and import the collection
go-firestore-jokes.postman_collection.json
at the root of the project - Run
go run cmd/main.go
from the root of the project