Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 1.44 KB

README.md

File metadata and controls

35 lines (26 loc) · 1.44 KB

FusionAuth QuickStart: Express API

Warning

This repository is generated from content that lives at github.com/FusionAuth/fusionauth-site. Changes to files here will be overwritten by that automation. File an issue or pull request with fusionauth-site instead.

This repository contains a locally hosted FusionAuth instance and an Express API. For full instructions, see the FusionAuth Express API QuickStart.

Dependencies

  • Node.js 22 or later.
  • Docker 23 or later.

Start FusionAuth

  1. Navigate to the fusionauth directory.
  2. Start FusionAuth with Docker Compose:
    docker compose up -d
    
  3. Open http://localhost:9011/admin. Log in with admin@example.com and the password password.

Start the API

  1. Open a new terminal in the repository root.
  2. Navigate to complete-application and install the dependencies:
    cd complete-application
    npm install
    
  3. Start the API:
    node api.mjs
    

The API listens on port 3000. Send access tokens in the Authorization: Bearer <token> header. The free@example.com user can call GET /read. The premium@example.com user can call POST /write.