new Controller()

Description
Controller class to handle all requests and responses.
Examples
const { Controller } = require("emfrest/controllers")

Usage

class CustomController extends Controller{
  usefulControllerFunction = (req, res, next) => {
    // Process request
    // Send response
  }
}
Details

Members


getAll

Description
Controller function to get all documents of a collection.
Details

createResource

Description
Controller function to create a new document.
Details

getOneById

Description
Controller function to get a single document by its id.
Details

updateOneById

Description
Controller function to update a document by its id.
Details

deleteOneById

Description
Controller function to delete a document by its id.
Details