An api which communicate with sqlite database
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Before starting make sure you have below packages installed:
- go version go1.13.1 linux/amd64 Optional:
- Docker version 18.09.7
- GNU Make 4.1
First, make sure your github profil have a ssh key to allow clone
git clone [email protected]:Royalsspirit/cisco-api.git
This repository is made to run in containers but the classic way is still available. Just follow corresponding section
Make sure that requirements are satisfied.
To run the api, just type:
make up
it will expose api server at port 8080
.
- Just run:
go run cmd/api/main.go
.
If you want to use other db than the db available in repository you could add a environnement variable in the previous command:
DB=PAHT_TO_DBFILE go run cmd/api/main.go
There are 4 available endpoints:
GET /character
to get list of people with their vehicles and speciesPUT /character/{id}
to update a people properties (send one of object returned by the previous endpoint)DELETE /character/{id}
to delete a people identified by his idPOST /character
to create a people
- make unit-tests
- CompileDaemon - Watches your .go files in a directory and invokes go build if a file changed. Nothing more.
- sqlite3 - sqlite3 driver conforming to the built-in database/sql interface
- Mux - A powerful HTTP router and URL matcher for building Go web servers
- Testify - A toolkit with common assertions and mocks that plays nicely with the standard library
TODO
We use SemVer for versioning. For the versions available, see the tags on this repository.
TODO