rjweb-server
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -21,3 +21,3 @@ /// <reference types="node" /> | ||
/** Set an HTTP Header to add */ setHeader: (name: string, value: string) => ctr; | ||
/** Set a Custom Variable */ setCustom: (name: string, value: any) => ctr; | ||
/** Set a Custom Variable */ setCustom: <Type extends keyof Custom>(name: Type, value: Custom[Type]) => ctr; | ||
/** Print a Message to the Client */ print: (msg: any) => ctr; | ||
@@ -24,0 +24,0 @@ /** The Request Status to Send */ status: (code: number) => ctr; |
{ | ||
"name": "rjweb-server", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Easy and Lightweight Way to create a Web Server in Node.js", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -294,4 +294,8 @@ <h1 align="center">Welcome to rjweb-server 👋</h1> | ||
Javascript | ||
https://replit.com/@RobertJansen/aous | ||
Typescript | ||
https://replit.com/@RobertJansen/aous-ts | ||
## Author | ||
@@ -298,0 +302,0 @@ |
@@ -211,9 +211,9 @@ import ctr, { ctrError } from "./interfaces/ctr" | ||
// Functions | ||
setHeader(name: string, value: string) { | ||
setHeader(name, value) { | ||
res.setHeader(name, value) | ||
return ctr | ||
}, setCustom(name: string, value: any) { | ||
}, setCustom(name, value) { | ||
ctr['@'][name] = value | ||
return ctr | ||
}, print(msg: any) { | ||
}, print(msg) { | ||
switch (typeof msg) { | ||
@@ -260,6 +260,6 @@ case 'object': | ||
}; return ctr | ||
}, status(code: number) { | ||
}, status(code) { | ||
res.statusCode = code | ||
return ctr | ||
}, printFile(file: string) { | ||
}, printFile(file) { | ||
const content = fs.readFileSync(file) | ||
@@ -266,0 +266,0 @@ res.write(content, 'binary') |
@@ -21,3 +21,3 @@ import { Server, IncomingMessage, ServerResponse } from "http" | ||
/** Set an HTTP Header to add */ setHeader: (name: string, value: string) => ctr | ||
/** Set a Custom Variable */ setCustom: (name: string, value: any) => ctr | ||
/** Set a Custom Variable */ setCustom: <Type extends keyof Custom>(name: Type, value: Custom[Type]) => ctr | ||
/** Print a Message to the Client */ print: (msg: any) => ctr | ||
@@ -24,0 +24,0 @@ /** The Request Status to Send */ status: (code: number) => ctr |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85213
316