Init Initialize App
Initialize your Blue Bird application.
npx blue-bird
A powerful structure based on Express and React, designed to build fast applications with hydrated components (Islands or Full views) and everything you need pre-configured.
npm install @seip/blue-bird
Tired of configuring CORS, Body Parsers, Cookies, and Routing every time you start a project? Blue Bird provides a solid, pre-configured base so you can go straight to the business logic, without losing the pure extensibility of Express.
Express, React (with Islands or Full views), Validations, JWT Auth, and Uploads ready to use.
Use the `.use()` method to configure Express middleware just like you always do.
Designed to scale with elegance.
Token generation and validation with middleware ready to protect your API or Web routes.
Multi-language validation engine with predefined rules and automatic messages.
File uploads to disk powered by Multer, configured for your public folder.
React, React Router pre-configured and ready to use in SPA or Islands mode o full view pages.
Vite ready to use , for dev and production.
Express pre-configured and ready to use in API mode and Web mode.
Everything about the Blue Bird Core API.
Initialize your Blue Bird application.
npx blue-bird
Setup React for your Blue Bird application.
npm run react
Setup Dev for your Blue Bird application.
npm run dev
Setup Vite for your Blue Bird application.
npm run vite:dev
Central configuration for your Express server.
import App from "@seip/blue-bird/core/app.js";
import routerUsers from "./routes/users.js";
const app = new App({
port: 3000,
routes: [routerUsers],
cors: { origin: '*' }
});
// Extend Express with .use()
app.use(myCustomMiddleware);
//Or app.set(key,value) example: app.set('view engine', 'ejs');
app.run();
| Option | Type | Default |
|---|---|---|
| port | Number | 3001 |
| routes | Array | [] |
| logger | Boolean | true |
| cookieParser | Boolean | true |
| cors | Object | {} |
| middlewares | Array | [] |
| port | Number | 3000 |
| host | String | "http://localhost" |
| notFound | Boolean | true |
| json | Boolean | true |
| urlencoded | Boolean | true |
| static | Object | {path: null, options: {}} (public folder default) |
| cookieParser | Boolean | true |
Render full views or hydrated react components (Islands or Full views) with a single method.
import Template from "@seip/blue-bird/core/template.js";
import router from "@seip/blue-bird/core/router.js";
const routerUsers = new Router("/")
router.get("/", (req, res) => {
// Render the 'Home' component with initial props
return Template.renderReact(res, "Home", { title: "My App" });
});
import Validator from "@seip/blue-bird/core/validate.js";
import router from "@seip/blue-bird/core/router.js";
const routerUsers = new Router("/api")
const schema = {
email: { required: true, email: true },
password: { required: true, min: 6 }
};
const validate = new Validator(schema, 'en');
router.post("/register", validate.middleware(), (req, res) => {
res.json({ message: "OK" });
});
import Auth from "...";
Auth.generateToken(payload);
Auth.protect(); // Middleware
import Upload from "...";
Upload.disk({ folder: 'img' });
// Based on Multer