gin-scaffold
gin-scaffold copied to clipboard
Gin scaffold is CLI to generate scaffolds for the gin gonic framework.
Gin Scaffold
Gin Scaffold
is CLI to generate scaffolds for the gin
framework.
For now the project only supports mongodb
and mgo
as database.
Installation
go get github.com/dcu/gin-scaffold
Initializing a project
gin-scaffold init <project path>
Creating a model
gin-scaffold model <model name> <field name>:<field type>
Creating a controller
gin-scaffold controller <controller name>
Creating a scaffold
gin-scaffold scaffold <controller name> <field name>:<field type>
Running
go run <project name>.go
Accessing
Open browser, and access to http://localhost:4000. (Default port:4000)
RESTful
- GET
List
curl 'http://localhost:4000/<controller name>
detail 1 by id
curl 'http://localhost:4000/<controller name>/<id>'
-
POST
curl -w '\n' 'http://localhost:4000/
' --data ' = ' -XPOST -
PUT
curl -XPUT 'http://localhost:4000/
/ ' -d ' = ' -
DELETE
curl -XDELETE 'http://localhost:4000/
/ '
License
MIT
Author
David Cuadrado (dcu)