Skip to content

Configurable route gateway with authentication and authorization

License

Notifications You must be signed in to change notification settings

mulab/mu-gateway

Repository files navigation

mu-gateway

Configurable route gateway with authentication and authorization

Configuration

export default {
  "target": "<protocol>://<hostname>:<port>[path]",
  "dbUrl": "mongodb://<host>:<port>/<name>",
  "default": function(method, user) {
    if (method === 'GET') return true;
    return false;
  }
  "rules": {
    "/profile/:name": function(method, user, name) {
      if (method === 'GET') return true;
      else if (method === 'POST') {
        if (user["name"] === name || "admin" in user["group"]) return true;
      }
      return false;
    }
  }
}

About

Configurable route gateway with authentication and authorization

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published