secret-server

secret-server hides your application behind a password

MIT License

Stars
1

secret-server

Secret-server hides your application behind a password

This module will make the application unaccessible until the user enters the correct password

Why?

This module was done with the intent to be used during development stages of an application, in order to be able to demo it to the client but keeping hidden from outsiders.

Installation

npm i secret-server

Usage


import secretServer from 'secret-server'

expressApp.use(cookieSession({
  name: 'session',
  keys: ['key1', 'key2'],
})) // or any other session (express-session for example)
expressApp.use(secretServer(/* configuration object */{
  password: 'test',
  redirect: '/',
  successRedirect: '/success',
})) // this should be done before setting the routes

Please check the tests folder for a more complete working example

Configuration object

All properties are not required

Property description default
password password to be used test
successRedirect path to redirect the user after a successful authorization undefined
redirect path to redirect the user when not authorized undefined
file path to the html file with the user input for authorization undefined

License

MIT

Badges
Extracted from project README
Donate on patreon Build Status codecov npm version dependencies Status devDependencies Status PRs Welcome GitHub