mojojs-passwordless-example
This is an small example of doing passwordless login with mojo.js.
Run example
You need a postgresql database and email server to run the example. See below for how to easily get those running with docker.
1. Start postgres and create database
docker run --rm --name pg-docker -e POSTGRES_PASSWORD=postgres -d -p 5432:5432 -v $HOME/docker/volumes/postgres:/var/lib/postgresql/data postgres
psql -h 'localhost' -c "CREATE DATABASE mojojs_passwordless_example_dev" "user=postgres dbname=postgres password=postgres"
maildev email server
2. StartYou will be able to check emails at http://localhost:1080.
docker run -d -p 1080:1080 -p 1025:1025 maildev/maildev
3. install dependencies and build
npm install
npm run build
4. Run migration
node lib/index.js migrate
minion.js background worker for handling signup & login email jobs
5. Startnode lib/index.js minion-worker --jobs 12
6. Start dev server
Leave the background worker running in a separate terminal window.
npm run dev