// main.jsimport '@bogeychan/elysia-polyfills/node/index.js';import { cors } from '@elysiajs/cors';import { html } from '@elysiajs/html';import { bearer } from '@elysiajs/bearer';import { swagger } from '@elysiajs/swagger';import { Elysia } from 'elysia';const app = new Elysia() .use(cors()) .use(html()) .use(bearer()) .use(swagger()) .get('/', () => ({ hello: 'Node.js👋' })) .listen(8080);console.log('Listening on http://localhost:8080');
// package.json{ "private": true, "type": "module", "main": "main.js", "dependencies": { "@bogeychan/elysia-polyfills": "0.6.1", "@elysiajs/cors": "0.7.2", "@elysiajs/html": "0.7.3", "@elysiajs/bearer": "0.7.0", "@elysiajs/swagger": "0.7.4", "elysia": "0.7.29" }}
npm i && node . # v18.16.0