// NewUserAPI derp func NewUserAPI(dbname string, dbuser string, port int) *UserAPI { api := &UserAPI{ App: app.NewApp(port), } api.App.AddDatabase(dbname, dbuser) api.App.AddMigrations("foo") api.App.AddRoute("GET", "/{id}", usersRead) api.App.AddRoute("GET", "/", usersIndex) api.App.AddRoute("POST", "/", UserCreate) database = *api.App.Database return api }
func main() { app := app.NewApp(8080) app.AddRoute("GET", "/", handler) app.Listen() }