Skip to content

JWebCoder/secret-server

Repository files navigation

secret-server

Donate on patreon Build Status codecov node npm version dependencies Status devDependencies Status PRs Welcome GitHub

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

About

secret-server hides your application behind a password

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 2

  •  
  •