api-server: github.com/DevMine/api-server/srv Index | Files | Directories

package srv

import "github.com/DevMine/api-server/srv"

Package srv provides utilities and functions to make the server running possible.


Package Files


func OpenDBSession Uses

func OpenDBSession(cfg config.DatabaseConfig) (*sql.DB, error)

OpenDBSession creates a session to the database.

func SetupRouter Uses

func SetupRouter(db *sql.DB, cors bool) *mux.Router

SetupRouter creates API routes. The cors parameter is used to specify whether to enable Cross Origin Resource Sharing or not.


contextPackage context creates a context to pass to each api-server route handlers functions.

Package srv imports 15 packages (graph) and is imported by 1 packages. Updated 2016-07-21. Refresh now. Tools for package owners.