Usage

Configure database (optional)

To use LadderJS with an authentication and a private area, you need a PostgreSQL database.

First, create a PostgreSQL database:

$ createdb <DATABASE_NAME>

Then, add a .env file at the root of your project:

/.env

# The database connection string
DATABASE_URL=postgres://<USER>:<PASSWORD>@<DATABASE>

# Enable the Sequelize logging, disabled by default
DATABASE_LOGGING=true

Create LadderJS instance

To start using LadderJS simply create anindex.jsfile containing the following:

const ladderjs = require('ladderjs')

const options = {}

const app = ladderjs(options)

app.start()

Then launch it use the command:

$ node .

You'll then have have a basic website, configured using all the default settings (check it in the configuration page). The basic app is using MaterializeCSS as CSS-JS framework, and shows a homepage, a login/signup pages, and a protected page.

NB

If you use Nodemon or any other file monitor, be sure tu exclude the sessions folder and the *.log files as they are automatically generated by the framework and would trigger a restart on each router call:

$ nodemon . -i sessions -i *.log

results matching ""

    No results matching ""