Code Monkey home page Code Monkey logo

Comments (3)

developit avatar developit commented on May 8, 2024 6

Facet is a silly word for this example, I keep meaning to change it but havent yet. It's just a collection of objects - normally you'd be using a database of some kind, we're just using an Array as a stand-in for a simple in-memory collection.

resource-router-middleware is used here because it promotes idiomatic REST - simple CRUD, guids for resources, etc. It's also a convenient way to automatically load a model instance (or fetch an object from a DB or something) for requests that will need access to it.

You can absolutely use this repo without resource-router-middleware, but I would still strongly recommend keeping the middleware semantic - export a factory function that returns an express Router so it can be instantiated and mounted as necessary. Without this, applications tend to devolve into singletons, which are much harder to re-use, test and refactor. You can see a direct example of the middleware factory approach here that doesn't use resource-router-middleware.

from express-es6-rest-api.

zouhir avatar zouhir commented on May 8, 2024

If you have any further questions @amberley please feel free to re-open or ask at anytime!

I'll try my best to update the docs asap with explanation.

from express-es6-rest-api.

designbuedchen avatar designbuedchen commented on May 8, 2024

@zouhir I really need an explanation to this. I really don't have an idea where to put this logically into. I would love to see an explanation to this 👍 Thanks in advance!

from express-es6-rest-api.

Related Issues (20)

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.