Skip to content

Non-restful lockit not work with restful lockit #25

Description

@idy

Hi zemirco,
I want to use a restful lockit with a non-restul lockit, which feeds all static pages while listen to ajax requests. There is no option to disable restful lockit from rendering, which make restful lockit won't work with non-restful lockit.
There are two approach to make it work, one is add options to add restful routers to a non-restful lockit, and the other is to add an option to disable rendering. I think the second approach is more clear.

Add one line to Lockit.prototype.rest

if (!this.config.rest.index) return;

This will prevent render pages if config.rest.index is not set.

Then I can use lockit as follow:

var Lockit = require('Lockit');
var express = require('express');
var restConfig;
var config;
var lockit = new Lockit(config);
var restLockit = new Lockit(restConfig);
app = express();
app.use(lockit.router)
app.use(restLockit.router);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions