mirror of
https://github.com/Wessel/kirbe.git
synced 2026-07-10 22:14:10 +02:00
Improvements
This commit is contained in:
@@ -2,15 +2,15 @@ const { parse } = require('url');
|
||||
|
||||
module.exports = class KirbeRequest {
|
||||
constructor(req, body) {
|
||||
this.url = req.url;
|
||||
this.req = req;
|
||||
this.body = body;
|
||||
this.from = req.connection.remoteAddress;
|
||||
this.method = req.method;
|
||||
this.headers = req.headers;
|
||||
this.parsedUrl = parse(this.url, true);
|
||||
this.url = req.url;
|
||||
this.req = req;
|
||||
this.body = body;
|
||||
this.from = req.connection.remoteAddress;
|
||||
this.method = req.method;
|
||||
this.headers = req.headers;
|
||||
this.parsedUrl = parse(this.url, true);
|
||||
}
|
||||
|
||||
json() { return JSON.parse(this.body); }
|
||||
query (name) { return this.parsedUrl.query[name]; }
|
||||
json() { return JSON.parse(this.body); }
|
||||
query (name) { return this.parsedUrl.query[name]; }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user