Skip to main content

Getting Started

Get started by creating a new api with crumbjs.

What you'll need

  • Bun version 1.2.20 or above:

Create your project

With a very raw template with cors and a hello route:

bun create crumbjs@latest api

You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.

Start your server

Run the development server:

cd api
bun run dev

Make a request!

Example with default settings

curl http://localhost:8080/api/hello/crumb

You will se something like this:

StatusCode        : 200
StatusDescription : OK
Content : {"hello":"crumb"}
RawContent : HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT
Access-Control-Allow-Headers: Content-Type,Authorization
Cross-Origin-Resource-P...
Forms : {}
Headers : {[Access-Control-Allow-Origin, *], [Access-Control-Allow-Methods,
DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT], [Access-Control-Allow-Headers,
Content-Type,Authorization], [Cross-Origin-Resource-Policy, same-origin]...}

Or open in your browser http://localhost:8080/api/hello/crumb