Skip to content

Quick Start

This document is a step-by-step guide for basically setting up Hitchy with support for authentication and authorization using this plugin.

Setup Project

Create a folder for your application and enter it:

bash
mkdir my-new-app
cd my-new-app

Initialize your application's package management so dependencies are tracked:

bash
npm init -y

Install @hitchy/core and @hitchy/plugin-auth as dependencies:

bash
npm install @hitchy/core @hitchy/plugin-auth

TIP

Plugin @hitchy/plugin-auth is implicitly fetching @hitchy/plugin-odem, @hitchy/plugin-session and @hitchy/plugin-cookies as dependencies.

Start Hitchy

At this point Hitchy is ready. Thus, start it with:

bash
hitchy start

Hitchy not found?

If Hitchy isn't found this might be due to issues with your Node.js and npm setup. In most cases using npx solves this issue for now:

bash
npx hitchy start

Keep it running while trying out next.

TIP

Whenever you want to stop Hitchy press Ctrl+C to gracefully shut it down.

Try It Out

The plugin injects special endpoints for managing a user's authentication by default. You should be able to authenticate with a request like this:

http
POST /api/auth/login HTTP/1.0
Content-Type: application/x-www-form-urlencoded

username=admin&password=nimda

This works due to the default configuration for implicitly setting up administrator account on application start.