Wessel T d9102557f9 Merge pull request #2 from ohlookitsderpy/patch-1
Improvements to extensions and readme
2019-01-17 15:56:05 +01:00
2019-01-17 13:17:45 +00:00
2019-01-16 17:06:03 +01:00
2019-01-16 17:06:03 +01:00
2019-01-16 17:06:03 +01:00
2019-01-16 17:06:03 +01:00
2019-01-16 17:04:36 +01:00
2019-01-16 18:30:28 +01:00
2019-01-17 13:30:15 +00:00
2019-01-16 17:06:03 +01:00


Kirbe


Install Size Discord NPM version NPM version Patreon

npm installnfo

A lightweight and fast Node.js HTTP server library

GitHub | NPM

Installing

$ yarn add kirbe # Install w/ Yarn (the superior package manager)
$ npm i kirbe # Install w/ NPM

Usage

Start a HTTP(s) server on port 8080 and add some routes

const kirbe = require( 'kirbe' ); // Define kirbe
const app = new kirbe(); // Make your kirbe client

app.route( '/bear', 'GET', ( req, res ) => res.status( 200 ).body({ 'bear': 'cop' }) );
app.route( ( req, res ) => res.status( 404 ).body( 'Error: Content not found!' ).end() );
app.get( '/kirb', ( req, res ) => {
  res.writeHead( 201, { 'test': 'hi' });
  res.end({ 'key': 'hi' });
});

// HTTP
app.listen( 8080, () => console.log( 'Listening on port 8080!' ) );
// HTTPS
const https = require( 'https' ); // This should be at the top of your code
https.createServer( app.externalHandler ).listen( 8080 );

Default extensions ( /extensions )

Static

Host static files on your website

Usage
const path  = require( 'path' ); // Define path
const kirbe = require( 'kirbe' ); // Define kirbe
const app = new kirbe(); // Make your kirbe client

app.use( kirbe.static( path.join( __dirname, 'static' ) ) );

Why use kirbe?

Kirbe is a lightweight and fast HTTP server library, especially comparing to express and connect which are around 1mb in size with multiple dependencies. If you want any features that aren't inside of Kirbe yet, you can open an issue or pull request.

You can join https://discord.gg/SV7DAE9 if you need any support using kirbe!

Description
👻 A powerful and lightweight Node.js HTTP server library
Readme MIT 128 KiB
Languages
JavaScript 100%