Minimalistic API Framework with Strong Schema
npm install as-facile-js
Lightweight, minimal API framework with a friendly CLI.
bash
npm install as-facile-js
`Quick start
`ts
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
$3
`bash
npx as-facile-js init my-api
or shorthand
npx as-facile-js my-api
`$3
`bash
cd my-api
npx as-facile-js -g users
`$3
`bash
npx as-facile-js --help
npx as-facile-js --version
`Project structure (generated)
`
my-api/
src/
server.ts
modules/
# generated by default
health/
health.controller.ts
health.payload.ts
health.route.ts
health.service.ts
`Scripts (generated project)
`bash
npm run dev
``