Code Monkey home page Code Monkey logo

mvcrest's Introduction

#MVC REST This is a rest api that uses MVC structure to produce a simple and reliable rest service with quick and easy set up.

Setup

This are settings important to how the application it to function. There are a few ways to define settings

  1. Define settings in settings.json

    This is should be used to define all the setting that are important to the project in a single place

  2. Define settings in their respective files.

    Sometimes projects might get big, and you might not be able to keep up with some settings. Thus, one might need to define settings in a singular files to avoid the clutter of most of the other files.

Url

The api uses REST url model (Structured URL's)

https://example.com/Users returns all users https://example.com/Users/3 return user with id 3 https://example.com/Users/3/name returns user 3, with the name.

Samples

https://baseurl.com/Items

This should return all the requested data type items i.e Users or Places

https://baseurl.com/Item

This should handle single item operations i.e User/2

Abstract url rules

Side note

table/column/value/amount

This structure can also be embraced, but you'd have to have column abstraction just for security
NB
The structure does not canter for multiple column rules
That can be handled with ?getters

Settings priority

The settings file should be considered as the main source of settings. Else, In a situation where explicit settings files are defined. The explicit definitions will be concidered first as they are less cluttered and should be less prone to errors.

ALL settings.json

{
  "db": {
  },
  "auth": {
  },
  "api": {
  }
}

API configs api.json

{
  "": "" 
}

DB Configs db.json

{
  "host": "your_host_name",
  "database_name": "your_database_name",
  "password": "your_database_password"
}

Security configs auth.json

This should handle things like api keys and how they are going to be handle from storage to generation rules

mvcrest's People

Contributors

breimerr avatar

Watchers

James Cloos avatar  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.