0.0.24 • Published 9 months ago

@mapl/app v0.0.24

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

Mapl

A low-overhead framework for all runtimes.

import { jitc, router } from '@mapl/app';

const app = router()
  // Example middleware
  .use((c) => c.headers.push(['server', 'mapl']))

  // Send normal text
  .get('/', {
    type: 'text',
    fn: () => 'Hi'
  })

  // Send html
  .get('/home', {
    type: 'html',
    fn: () => '<p>Hi</p>'
  });

  // Send JSON
  .get('/req', {
    type: 'json',
    fn: (ctx) => ctx
  });

// Compile the app to a fetch function
const fetch = jitc(app);

// Example request
fetch(new Request('http://127.0.0.1:3000')); // new Response('Hi')
0.0.24

9 months ago

0.0.21

9 months ago

0.0.22

9 months ago

0.0.23

9 months ago

0.0.20

9 months ago

0.0.19

9 months ago

0.0.16

9 months ago

0.0.17

9 months ago

0.0.18

9 months ago

0.0.13

9 months ago

0.0.14

9 months ago

0.0.15

9 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago