is-a-dev.com / autoapi

Automatic api generation from an SQL database, complete with http API endpoint scaffolding code and preconditions checking.

Olivier Tremblay:   53a13c92e2 Swagger generator now filters according to passed verbs. 1 year ago
lib 53a13c92e2 Swagger generator now filters according to passed verbs. 1 year ago
vendor 6d83cd1f4e Vendor deps 1 year ago
.gitignore db3adfef63 Added changes to autoapi main to main generator so application have the same parameter syntax as the generator, changed parameter name to match as well, added .project ide ignore to .gitignore 2 years ago
BUGS 6fc12db5e6 Fixed a few bugs. 2 years ago
LICENSE 4d0a84e56a Init commit 2 years ago
README.md ae58d97545 Updated calling syntax for application in readme.md, few other minor changes there too 2 years ago
TODO b4aee6ce21 First working prototype for a simple table. 2 years ago
all.json cdbaf2bf58 Basic json-ld mapping 2 years ago
main.go bc8849901c New flags! 1 year ago

README.md

AUTOAPI

Automatic api generation from an SQL database, complete with http API endpoint scaffolding code and preconditions checking.


Prerequisites

go get github.com/gorilla/mux

Installation

# Get package
go get is-a-dev.com/autoapi

# See that it works (if your go env is setup properly)
autoapi --help

Create a new API

cd $GOPATH/src
mkdir autoapiapp && cd autoapiapp
autoapi -d="DB_NAME" -u="root" -h="localhost" -P="3306"

Once this step is complete your directory should now look like:

$GOPATH/src/whatever/
        bin/
            main.go (Main application binary, run this to start it)
        db/
            /mysql
                /DB_TABLES (Database queries themselves for mysql)
        dbi/
            /DB_TABLES
        http/
            /DB_TABLES

Starting the API

From your project root:

go run bin/main.go -d="DB_NAME" -u="root" -h="localhost" -P="3306"

Your api will now be runnning on: http://localhost:8080 (by default)

Additional Configuration

  • How to change the port and host
  • Other amazing features
# TODO Configurable all the things

Working with your new project

# TODO need to write more guidelines and tips for how to use this for awesome things
  • It is a good idea to use the routes generated as the base for your project, and include them in new packages instead of modifying them directly.

Project Roadmap

  • Finish constriant issues
  • Complete Swagger
  • Complete JSON-LD
  • Onwards to glory
# TODO Need to add some more items here, not sure on priority

Contributing

# TODO Need to write some guidelines you want for contributing to this project

Contributors