🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

github.com/jeremiascaballero/apigolangmvc

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/jeremiascaballero/apigolangmvc

v0.0.0-20201121231008-f2ae409442cf
Source
Go
Version published
Created
Source

ApiGolangMvc

Pequeño proyecto en formato mvc para el seminario de golang

La rama main cuenta con la estructura mvc, y el modelo implementando con GORM

Se debe importar la base de datos o crear una (vuelo), las tablas que esta contenga se crean solas al iniciar el main.go

Como iniciar la ApiRest

  • Importar la base de datos que se encuentra en /database, a su dominio
  • En caso de no importarla se creara automaticamente
  • Ejecutar main.go (go run main.go)
  • Abrir Postman o en el navegador localhost:8080/endpoint

Tabla de ruteo

GetVuelosGetVueloAddvueloDeletevueloUpdatevuelo
localhost:8080/getvuelos (trae todos los vuelos)localhost:8080/getvuelo/:id (trae un vuelo dado un id)localhost:8080/addvuelo/:id (agrega un vuelo dado un id)localhost:8080/deletevuelo/:id (elimina un vuelo dado un id)localhost:8080/updatevuelo/:id (actualiza un vuelo dado un id)

Enviando un JSON

Para enviar datos al servidor se necesita crear un JSON con la siguiente estructura

{
   "Destino" "agregeUnDestino" // string
}

FAQs

Package last updated on 21 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts