Categorygithub.com/Alfabetss/simple-rest-api
modulepackage
0.0.0-20200301143826-a928d661a9cf
Repository: https://github.com/alfabetss/simple-rest-api.git
Documentation: pkg.go.dev

# README

Simple-rest-api

create simple API using echo framework

Getting Started

in this repository we will implement echo framework to create APIs that implement common http methods namely GET, POST, PUT, DELETE.

Prerequisites

some things that must have or be installed to run this program :

Create Table

To create a table you can copy the script in the /script/*.sql folder and run in your database

Configuration

NameTypeDefaultRequiredExample Value
PortString:8888Yes:8080
DBNameString-Yesexample_database
DBProtocolString-Yestcp
DBHostString-Yeslocalhost
DBPortString-Yes3360
DBUserString-Yesroot
DBPassString-Yesadministrator

Running

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" 

Built With

  • Echo - The web framework used
  • squirrel - The Query Builder
  • viper - The Configuration tools

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author