How to use the forest-express.PUBLIC_ROUTES function in forest-express

To help you get started, we’ve selected a few forest-express examples, based on popular ways it is used in public projects.

github ForestAdmin / forest-express-sequelize / src / index.js View on Github external
exports.ResourceSerializer = Interface.ResourceSerializer;
exports.ResourceDeserializer = Interface.ResourceDeserializer;
exports.Schemas = Interface.Schemas;
exports.ResourcesRoute = Interface.ResourcesRoute;

exports.PermissionMiddlewareCreator = Interface.PermissionMiddlewareCreator;
exports.RecordsCounter = Interface.RecordsCounter;
exports.RecordsExporter = Interface.RecordsExporter;
exports.RecordsGetter = Interface.RecordsGetter;
exports.RecordGetter = Interface.RecordGetter;
exports.RecordUpdater = Interface.RecordUpdater;
exports.RecordCreator = Interface.RecordCreator;
exports.RecordRemover = Interface.RecordRemover;
exports.RecordSerializer = Interface.RecordSerializer;

exports.PUBLIC_ROUTES = Interface.PUBLIC_ROUTES;

exports.init = function init(opts) {
  exports.opts = opts;

  // NOTICE: Ensure compatibility with the old middleware configuration.
  if (opts.sequelize && !('connections' in opts)) {
    opts.connections = [opts.sequelize];
    opts.sequelize = opts.sequelize.Sequelize;
  }

  exports.getLianaName = function getLianaName() {
    return 'forest-express-sequelize';
  };

  exports.getLianaVersion = function getLianaVersion() {
    const lianaVersion = lianaPackage.version.match(REGEX_VERSION);
github ForestAdmin / forest-express-mongoose / src / index.js View on Github external
exports.collection = Interface.collection;
exports.ensureAuthenticated = Interface.ensureAuthenticated;
exports.StatSerializer = Interface.StatSerializer;
exports.ResourceSerializer = Interface.ResourceSerializer;

exports.PermissionMiddlewareCreator = Interface.PermissionMiddlewareCreator;
exports.RecordsCounter = Interface.RecordsCounter;
exports.RecordsExporter = Interface.RecordsExporter;
exports.RecordsGetter = Interface.RecordsGetter;
exports.RecordGetter = Interface.RecordGetter;
exports.RecordUpdater = Interface.RecordUpdater;
exports.RecordCreator = Interface.RecordCreator;
exports.RecordRemover = Interface.RecordRemover;
exports.RecordSerializer = Interface.RecordSerializer;

exports.PUBLIC_ROUTES = Interface.PUBLIC_ROUTES;

exports.init = (opts) => {
  exports.opts = opts;

  // NOTICE: Ensure compatibility with the old middleware configuration.
  if (!('connections' in opts)) {
    opts.connections = [opts.mongoose];
  }

  exports.getLianaName = () => 'forest-express-mongoose';

  exports.getLianaVersion = () => {
    const lianaVersion = require('../package.json').version.match(REGEX_VERSION);
    if (lianaVersion && lianaVersion[0]) {
      return lianaVersion[0];
    }