Learn the basics of CanxJS and create your first application.
Welcome to CanxJS! In this tutorial, we will walk through creating your first ultra-fast web application.
Before we begin, ensure you have the following installed:
The easiest way to start is using the CLI generator. Open your terminal and run:
bunx create-canx my-first-appFollow the interactive prompts:
Once created, let's look at the structure:
my-first-app/
├── src/
│ ├── app.ts # Entry point
│ ├── controllers/ # Route handlers
│ └── views/ # JSX templates
├── package.json
└── tsconfig.jsonCanxJS is designed to be simple. Open src/app.ts and add a basic route:
import { createApp } from "canxjs";
const app = createApp();
app.get("/", (req, res) => {
return res.json({ message: "Hello from CanxJS!" });
});
app.listen();Start your development server:
bun run devVisit http://localhost:3000 in your browser, and you should see your JSON response!
Have questions?
Join the discussion on GitHub