mirror of
https://github.com/Wessel/kirbe.git
synced 2026-07-28 02:50:55 +02:00
Improvements
This commit is contained in:
28
README.md
28
README.md
@@ -1,18 +1,18 @@
|
||||
<div align="center">
|
||||
<div align='center'>
|
||||
<br />
|
||||
<p>
|
||||
<img src="media/kirb.gif" /><h1 style="font-size:107px;">Kirbe</h1>
|
||||
<img src='media/kirb.gif' /><h1 style='font-size:107px;'>Kirbe</h1>
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
<a href="https://packagephobia.now.sh/result?p=kirbe"><img src="https://packagephobia.now.sh/badge?p=kirbe" alt="Install Size" /></a>
|
||||
<a href="https://discord.gg/SV7DAE9"><img src="https://discordapp.com/api/guilds/107131083958538240/embed.png" alt="Discord" /></a>
|
||||
<a href="https://www.npmjs.com/package/kirbe"><img src="https://img.shields.io/npm/v/kirbe.svg?maxAge=3600" alt="NPM version" /></a>
|
||||
<a href="https://www.npmjs.com/package/kirbe"><img src="https://img.shields.io/npm/dt/kirbe.svg?maxAge=3600" alt="NPM version" /></a>
|
||||
<a href="https://www.patreon.com/wessel"><img src="https://img.shields.io/badge/donate-patreon-F96854.svg" alt="Patreon" /></a>
|
||||
<a href='https://packagephobia.now.sh/result?p=kirbe'><img src='https://packagephobia.now.sh/badge?p=kirbe' alt='Install Size' /></a>
|
||||
<a href='https://discord.gg/SV7DAE9'><img src='https://discordapp.com/api/guilds/107131083958538240/embed.png' alt='Discord' /></a>
|
||||
<a href='https://www.npmjs.com/package/kirbe'><img src='https://img.shields.io/npm/v/kirbe.svg?maxAge=3600' alt='NPM version' /></a>
|
||||
<a href='https://www.npmjs.com/package/kirbe'><img src='https://img.shields.io/npm/dt/kirbe.svg?maxAge=3600' alt='NPM version' /></a>
|
||||
<a href='https://www.patreon.com/wessel'><img src='https://img.shields.io/badge/donate-patreon-F96854.svg' alt='Patreon' /></a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://nodei.co/npm/kirbe/"><img src="https://nodei.co/npm/kirbe.png?downloads=true&stars=true" alt="npm installnfo" /></a>
|
||||
<a href='https://nodei.co/npm/kirbe/'><img src='https://nodei.co/npm/kirbe.png?downloads=true&stars=true' alt='npm installnfo' /></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -33,11 +33,11 @@ const kirbe = require('kirbe'); // Define kirbe
|
||||
|
||||
const app = new kirbe.Server(); // Make your kirbe instance
|
||||
|
||||
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.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' });
|
||||
res.writeHead(201, {'test': 'hi'});
|
||||
res.end({'key': 'hi'});
|
||||
});
|
||||
|
||||
// HTTP
|
||||
@@ -55,9 +55,9 @@ Host static files on your website
|
||||
const path = require('path'); // Define path
|
||||
const kirbe = require('kirbe'); // Define kirbe
|
||||
|
||||
const app = new kirbe(); // Make your kirbe instance
|
||||
const app = new kirbe.Server(); // Make your kirbe instance
|
||||
|
||||
app.use(kirbe.static(path.join(__dirname, 'static')));
|
||||
app.use(kirbe.Static(path.join(__dirname, 'static')));
|
||||
```
|
||||
|
||||
### Creating your own
|
||||
|
||||
Reference in New Issue
Block a user