https://github.com/osprogramadores/quotes-backend
Implements an inspirational quotes back end using Go.
https://github.com/osprogramadores/quotes-backend
Last synced: 12 months ago
JSON representation
Implements an inspirational quotes back end using Go.
- Host: GitHub
- URL: https://github.com/osprogramadores/quotes-backend
- Owner: OsProgramadores
- Created: 2021-04-01T04:40:56.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-07T05:21:59.000Z (about 2 years ago)
- Last Synced: 2024-04-17T05:13:18.822Z (about 2 years ago)
- Language: Go
- Size: 27.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Quotes
# What does this code do?
This code implements a back end that returns a JSON file containing a random inspirational quote and the respective author.
The quotes are stored in a sqllite database.
The following data is returned to the API consumer:
```
Quote
Author
```
Please note that the sample Quotes database file contains a list of quotes in Portuguese. You are welcome to adjust to your language as needed.
## Prerequisites
[Install Go](https://golang.org/doc/install)
## How does it work?
Build the code
```
go build
```
Run the program
```
./quotes
```
Basic test
```
curl localhost:8080/
```
Expected result
```
{"Quote":"Random quote.","Author":"Random Quote Author"}
```
## Running as a Docker container
The following scripts have been created for your convenience
build.sh
start.sh
stop.sh
use chdmod +x scrip_name to ensure that the scripts can execute
**build image**
./build.sh
**start container**
./start.sh
**stop container**
./stop.sh
**testing container app
curl localhost:8080/ or acess localhost:8080 on your favourite web browser
## Author
[**Marcelo Pinheiro**](https://github.com/mpinheir)
## License
Copy and use as you wish.
## Thank you
* [Go Language creators](https://en.wikipedia.org/wiki/Go_(programming_language))
* To [Marco Paganini](https://github.com/marcopaganini) for his guidance