This REST API provides data and service needed in candhi app.
For the initial installation, please make sure you have go installed in your computer.
To check if Golang is installed :
go version
To install Candi REST API to your machine, first download / clone this git repository.
go to your favorite terminal, then run this command to install all dependencies to your machine
go mod tidy
To run Candhi REST API, run this command and make sure the port that needed is still available in your machine and your IP is registered to the MySQL connection instance in the Google Cloud Platform ☁️
go run main.go
if the application is running correctly you will see this similar message in your terminal log
Koneksi Berhasil !
Start Development server on port :3000
These are API endpoints available categorized by its table in database
Get all trivias, METHOD = GET
http://34.101.198.95:3000/api/trivias
Create Trivia, METHOD = POST
http://34.101.198.95:3000/api/trivia/create
Update Trivia, METHOD = PUT
http://34.101.198.95:3000/api/trivia/{id}/update
Delete Trivia, METHOD = DELETE
http://34.101.198.95:3000/api/trivia/{id}/delete
Get all Candi, METHOD = GET
http://34.101.198.95:3000/api/candis
Create Candi, METHOD = POST
http://34.101.198.95:3000/api/candi/create
Update Candi, METHOD = PUT
http://34.101.198.95:3000/api/candi/{id}/update
Delete Candi, METHOD = DELETE
http://34.101.198.95:3000/api/candi/{id}/delete
Get all Article, METHOD = GET
http://34.101.198.95:3000/api/articles
Get all Article by category, METHOD = GET
http://34.101.198.95:3000/api/article/{category}
Create Article, METHOD = POST
http://34.101.198.95:3000/api/article/create
Update Article, METHOD = PUT
http://34.101.198.95:3000/api/article/{id}/update
Delete Article, METHOD = DELETE
http://34.101.198.95:3000/api/article/{id}/delete
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Made by cloud-computing team Faqqih and Ayi