/RESTful-API-test

A very limited RESTful API in which you can GET and POST data from a database via a CLI http client.

Primary LanguageShellMIT LicenseMIT

RESTful-API-test

Go Report Card GoDoc Maintainability Issue Count License

RESTful-API-test is a very limited RESTful API in which you can GET and POST data from a database via a CLI http client.

RESTful-API-test GitHub Webpage

ORIGINAL SOURCE

Original go code from phalt.

Written in go using gin & gorp.

RUN

From Command line

go run main.go

In another terminal, use a CLI http client like httpie and you can do the following commands:

Create New Article

http POST localhost:8000/articles title="A simple RESTful-API-test" content="Hello-World"

Query Entry List - Returns all articles in the list

http localhost:8000/articles

Query Single Resource - Get back single article via it's id

http localhost:8000/articles/1

UPDATE GITHUB WEBPAGE & UNIT TESTS USING CONCOURSE (OPTIONAL)

For fun, I use concourse to update RESTful-API-test GitHub Webpage, run my unit-tests and alert me of the changes via repo status and slack.

A pipeline file pipeline.yml shows the entire ci flow. Visually, it looks like,

IMAGE - RESTful-API-test concourse ci pipeline - IMAGE

The jobs and tasks are,

The concourse resources types are,

  • RESTful-API-test uses a resource type docker-image to PULL a repo from github.
  • resource-slack-alert uses a resource type docker image that will notify slack on your progress.
  • resource-repo-status uses a resource type docker image that will update your git status for that particular commit.

For more information on using concourse for continuous integration, refer to my cheat sheet on concourse.