create simple API using echo framework
in this repository we will implement echo framework to create APIs that implement common http methods namely GET, POST, PUT, DELETE.
some things that must have or be installed to run this program :
To create a table you can copy the script in the /script/*.sql folder and run in your database
| Name | Type | Default | Required | Example Value |
|---|---|---|---|---|
| Port | String | :8888 | Yes | :8080 |
| DBName | String | - | Yes | example_database |
| DBProtocol | String | - | Yes | tcp |
| DBHost | String | - | Yes | localhost |
| DBPort | String | - | Yes | 3360 |
| DBUser | String | - | Yes | root |
| DBPass | String | - | Yes | administrator |
clone repository :
git clone https://github.com/Alfabetss/simple-rest-api.git
open terminal :
cd path/to/program
run the program :
go run server.go
open new terminal, and run :
curl "http://localhost:1122/talent" \
-X POST \
-d "{\n \"name\": \"robert jr\",\n \"experience\": [\n {\n \"companyName\": \"marvel\"\n },\n {\n \"companyName\": \"sony\"\n }\n ]\n}" \
-H "Content-Type: application/json"