Code Monkey home page Code Monkey logo

mongodm-example's Introduction

Example API for mongodm

This is an example REST API for the mongodm package written in golang with use of the beego web framework. To simplify response/error handling the beego-response package is also included as an example.

There are two controllers (User and Message) where you can create and get something.

You will find an implementation for

  • Connection setup
  • Models
  • Model registration
  • Model creation (persisting/saving)
  • Population
  • Relations (1:1, 1:N)
  • Querys (Find, FindOne, ..)
  • Custom validation
  • Default validation
  • Localisation example
  • Response-/Error-Handling
  • Pagination
  • Using namespaces, routers and filters with beego
  • Dealing with a "Base-Controller" in beego

You won`t find an implementation for

  • Model updating
  • Model deleting
  • Authentication

Maybe I will add the missing points later..

Requirements

  • golang setup
  • a mongo database (by now password authentication is not supported)
  • some REST client for testing (optional)
  • beego package go get github.com/astaxie/beego
  • mongodm package go get github.com/zebresel-com/mongodm
  • beego-response package go get github.com/zebresel-com/beego-response

Quickstart

Move to your project directory and run go build; ./mongodm-sample (Unix) and beego should start the webserver on port 8080 for you. You can change beego settings in conf/app.conf, if necessary. To find all implemented and available REST endpoints open up apidoc/index.html in your browser. Thats all, you can test now!

Feel free to contribute!

Ask if you think that there is something missing.

mongodm-example's People

Contributors

moehlone avatar

Watchers

James Cloos avatar Tanguy ⧓ Herrmann avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.