Un cousin d'Express sous Bun
Développeur Auvergnat Rhônalpin
Formateur Numérique Responsable
📅 16 novembre 2010
⭐️ 66.2k
👥 326
🟨 JavaScript
📅 24 décembre 2022
⭐️ 11.3k
👥 60
🟦 TypeScript
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send('Hello World!');
});
app.listen(3000, () => {
console.log(`Example app listening on port ${port}`);
});
import { Elysia } from 'elysia';
const app = new Elysia()
.get('/', 'Hello World!')
.listen(3000);
console.log(
`Example app listening on port ${app.server?.port}`
);
Static Code Analysis and Dynamic Code Injection using JIT compilation.
eval
eval('console.log("Hello, World!")')
const say = new Function('something', 'console.log(something)')
say('Hello, World!')
const inference = sucrose({
handler,
...lifeCycle,
})
let fn = 'const context = {'
if(inference.body)
fn += 'body: await parseBody(body)\n'
fn += '}'
fn += `return handler(context)`
return new Function('context', fn)
import { Elysia } from 'elysia';
const app = new Elysia()
.get('/ok', function* ({ set }) {
set.headers['x-name'] = 'Elysia'
yield "1"
yield "2"
});
bun create elysia app
Chat avec Inscription et API Rest en moins de 10 minutes