Back to packages list

Vals using elysia

Description from the NPM package:
Ergonomic Framework for Human

Elysia example

This is how you can use Elysia with Val Town.

1
2
3
4
5
6
7
export const elysia = async (req) => {
const items = [];
const { Elysia } = await import("https://esm.sh/elysia@0.7.15");
const app = new Elysia()
.get("/", () => items).post("/", () => items.push(Math.random()));
return app.fetch(req);
};

Elysia example

This is how you can use Elysia with Val Town.

1
2
3
4
5
6
export const elysiaExample = async (req) => {
const { Elysia } = await import("https://esm.sh/elysia@0.7.15");
const app = new Elysia()
.get("/", () => "Hello Elysia");
return app.fetch(req);
};

Elysia example

This is how you can use Elysia with Val Town.

1
2
3
4
5
6
export const elysiaExample = async (req) => {
const { Elysia } = await import("https://esm.sh/elysia@0.7.15");
const app = new Elysia()
.get("/", () => "Hello Elysia");
return app.fetch(req);
};
1
Next