Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

CSRF middleware example

Simple tinyhttp app using Malibu as the CSRF middleware

Setup

Install dependencies

tinyhttp new malibu

Run

node index.js

Endpoints

GET / will return CSRF token in form of { "token": "csrf token" }

POST / will do everything else, but it's protected with CSRF token.

Example request:

curl --header 'csrf-token: csrf_token_from_get_request' --request POST http://localhost:3000/