🔒
Pagelock
  • Pagelock
Powered by GitBook
On this page
  • Install the package
  • Initialize
  • Arguments
  • Configuration
  • NPM Page
  • License

Was this helpful?

Pagelock

A simple express middleware to password-protect your pages

Last updated 2 years ago

Was this helpful?

Want to password-protect an Express endpoint? Use Pagelock! When attempting to access a locked page, an "Enter code" page will show up, if you enter the code correctly, the page will be replaced with the file you specified.

Install the package

npm i pagelock

Initialize

const app = require("express")() 
const pagelock = require('pagelock')
const lock = pagelock('password', { config:"here" })

app.get('/*', lock, (req, res) => {
res.send('Hello World')
})

app.listen(3000)

Arguments

Name
About
Type

password

Password

String

config

More details below

Object

Configuration

Name
About
Type

espionageMode

Allow junk to be on either side of real code. (EX: Code is 1234, Pagelock will accept 5551234666)

Bool

caseSensitive

If code needs to match case.

Bool

css

Custom CSS

String (File path)

NPM Page

License

Pagelock is available under the MIT License

npm: pagelocknpm
Default lock page
Lock page
Logo