as-facile-js
v1.0.3
Published
Minimalistic API Framework with Strong Schema
Readme
Features
- ⚡ Lightweight HTTP framework with middleware and routing.
- 🧩 Simple router with path params and middleware chaining.
- 🧰 Built-in CLI to scaffold a new project or generate modules.
Installation
npm install as-facile-jsQuick start
import { createApp, Router, json } from "as-facile-js";
const app = createApp();
app.use(json());
const router = Router();
router.get("/health", (req, res) => {
res.json({ ok: true });
});
app.use(router);
app.listen(3000, () => {
console.log("Server running on http://localhost:3000");
});CLI usage
Initialize a new project
npx as-facile-js init my-api
# or shorthand
npx as-facile-js my-apiGenerate a module
cd my-api
npx as-facile-js -g usersCLI help / version
npx as-facile-js --help
npx as-facile-js --versionProject structure (generated)
my-api/
src/
server.ts
modules/
# generated by default
health/
health.controller.ts
health.payload.ts
health.route.ts
health.service.tsScripts (generated project)
npm run devLicense
ISC
