11.0.0 • Published 3 years ago

@lukekaalim/server v11.0.0

Weekly downloads
278
License
MIT
Repository
github
Last release
3 years ago

@lukekaalim/server

Library for building simple servers.

Installation

npm i @lukekaalim/server

Usage

This server will return "Hello World" on port 8080 when requesting "/greetings", and 404 on all other responses.

const { text, route, router } = require('@lukekaalim/server');
const { createServer } = require('http');

const main = () => {
  const myRoute = route(
    'GET',
    '/greetings',
    () => text.plain(200, 'Hello World!')
  );
  const myRouter = router([myRoute]);
  const myServer = createServer(myRouter);

  myServer.listen(8080);
};

main();
11.0.0

3 years ago

9.4.1

3 years ago

9.4.0

3 years ago

9.3.0

3 years ago

9.2.0

3 years ago

9.1.1

3 years ago

9.1.0

3 years ago

9.0.0

3 years ago

8.1.1

3 years ago

8.1.0

3 years ago

8.0.4

3 years ago

8.0.3

3 years ago

8.0.2

3 years ago

8.0.1

3 years ago

8.0.0

3 years ago

7.1.2

3 years ago

7.1.1

3 years ago

7.1.0

3 years ago

6.0.1

3 years ago

6.0.0

3 years ago

6.0.2

3 years ago

7.0.0

3 years ago

5.2.1

3 years ago

5.2.0

3 years ago

5.1.0

4 years ago

5.0.2

4 years ago

5.0.1

4 years ago

5.0.0

4 years ago

4.1.0

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.2.0

5 years ago