Skip to content

Commit 9a99056

Browse files
committed
fixing README
1 parent be48c99 commit 9a99056

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

README.md

+16-12
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
## Table of Contents
77

88
- [About](#about)
9-
- [Features](#features)
109
- [Install](#install)
11-
- [Run](#run)
10+
- [Features](#features)
1211
- [Create an app](#create-an-app)
1312

1413
## About
@@ -17,6 +16,12 @@ This is a minimalistic Web framework for Node.js. It helps you create RESTful AP
1716

1817
The idea is to have 0 dependencies while still have all the functionality you would expect from bigger frameworks like Express, Koa, Fastify etc with just a fraction of the footprint.
1918

19+
## Install
20+
21+
```bash
22+
npm install quarkhttp
23+
```
24+
2025
## Features
2126

2227
- Create routes supporting GET, POST, PUT, DELETE HTTP Verbs. There are convenience methods for this:
@@ -49,30 +54,23 @@ The idea is to have 0 dependencies while still have all the functionality you wo
4954
```javascript
5055
app.get('/products/:id', (req, res) => {
5156
console.log(req.params) // for route /products/1 { id: "1" }
52-
console.log(req.query) // for route /products?page=1&pageSize=20 { page: "1", pageSize: "20"}
5357
})
5458
```
5559

56-
**Query parameters**
60+
**Query parameters**
5761

5862
```javascript
5963
app.get('/products/', (req, res) => {
6064
console.log(req.query) // for route /products?page=1&pageSize=20 { page: "1", pageSize: "20"}
6165
})
6266
```
6367

64-
## Install
65-
66-
```
67-
npm install mini-web
68-
```
69-
7068
## Create an app
7169

7270
```javascript
73-
const miniweb = require('quarkhttp');
71+
const quark = require('quarkhttp');
7472

75-
const app = miniweb();
73+
const app = quark();
7674

7775
// ROUTE PARAMETERS
7876
app.get("/products/:id", (req, res) => {
@@ -92,6 +90,12 @@ app.post('/products', (req,res) => {
9290
res.json(req.body);
9391
})
9492

93+
// PUT
94+
app.put('/products', (req,res) => {
95+
console.info('body', req.body)
96+
res.json(req.body);
97+
})
98+
9599
// MIDDLEWARE
96100
app.get('/orders', (req, res, next) => {
97101
if (req.headers['authorization'] === 'abc123') {

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "quarkhttp",
3-
"version": "0.8.3",
3+
"version": "1.0.0",
44
"engines": {
55
"node": ">=10.0.0"
66
},
@@ -31,7 +31,7 @@
3131
]
3232
},
3333
"keywords": [
34-
"mini-web",
34+
"quarkhttp",
3535
"framework",
3636
"web",
3737
"http",

0 commit comments

Comments
 (0)