https://github.com/thimc/go-rest-api
a demo REST API written in go using native packages
https://github.com/thimc/go-rest-api
Last synced: about 1 year ago
JSON representation
a demo REST API written in go using native packages
- Host: GitHub
- URL: https://github.com/thimc/go-rest-api
- Owner: thimc
- License: mit
- Created: 2023-05-15T15:13:56.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-20T11:16:23.000Z (about 3 years ago)
- Last Synced: 2024-06-21T04:48:51.561Z (almost 2 years ago)
- Language: Go
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# REST API using Go
* main.go sets up the handlers and listening on the TCP network address.
* handlers.go contains all the CRUD (create, read, update and delete) HTTP handlers.
* utils.go contains a wrapper function that sets the response headers and HTTP
code. It also marshals the response struct as a JSON and writes it to the
body.
The "database" is initialized in the main.go file and the data is not
persistent.
## Note
This API was created for educational purposes only and should only be treated as
such, it is not production ready.