@tophattedcoder/elysia-fs-router
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

tAt

Elysia Filesustem Router

A plugin for Elysia.js for server-side APIs

This works similarly to NextJS Router. Routes are created in an API directory

Installation:

bun add @tophattedcoder/elysia-fs-router

Usage

/index.ts

import {Elysia} from 'elysia'
import {nextRouter} from '@tophattedcoder/elysia-fs-router'

const app = new Elysia()
router(nextRouter())
app.listen(8080)
console.log("Server listening at http://localhost:8080")

/api/[id]/info

import {Context} from "elysia";

export default async function (ctx: Context) {
    return ctx.params!.id;
};

Readme

Keywords

none

Package Sidebar

Install

npm i @tophattedcoder/elysia-fs-router

Weekly Downloads

0

Version

0.0.4

License

none

Unpacked Size

42 MB

Total Files

942

Last publish

Collaborators

  • tophattedcoder