golang-starter

command module
v0.0.0-...-bea3340 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2020 License: MIT Imports: 4 Imported by: 0

README

GitHub issues GitHub forks GitHub license

Go, MongoDB and Docker

A simple Golang API skeleton heavly inspired by NodeJs + Express + MongoDB aplications.That way it is easier for Node developers to start creating new performant APIs with Go.

How to run

The easiest way to run this project is by installing Fresh.

go get github.com/pilu/fresh

Then, just type:

fresh

If you're going to run via docker change the .env

Instead of...

DATABASE_URL=localhost

Use.

DATABASE_URL=mongo

Then run the magic command:

docker-compose up

Organization

It is very similar to a commom Node + Express project, with routes,models and handlers (controllers) folder.

    .
    ├── ...
    ├── src
    |   ├── context              # To keep project constants, db sessions ... etc 
    │   ├── db                   # package that integrates with MongoDb
    │   ├── handlers             # here is where you're going to deal with incoming requests
    |   ├── models               # The models for MongoDB
    │   ├── routes
    |   |    |── routes.go       # Routes main file 
    |   └──  utils               # utility methods   
    └── ...

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL