Comparing version 0.5.6 to 0.5.7
@@ -26,21 +26,23 @@ "use strict"; | ||
// shared with text | ||
bufferOrStream = Buffer.from(data, charset); | ||
bufferOrStream = Buffer.from(data ?? '', charset); | ||
break; | ||
case 'buffer': | ||
setContentType('application/octet-stream'); | ||
bufferOrStream = data; | ||
bufferOrStream = data ?? Buffer.from('', charset); | ||
break; | ||
case 'nodeStream': | ||
setContentType('application/octet-stream'); | ||
bufferOrStream = data; | ||
bufferOrStream = data ?? Buffer.from('', charset); | ||
break; | ||
case 'webStream': | ||
setContentType('application/octet-stream'); | ||
bufferOrStream = node_stream_1.Readable.fromWeb(data); | ||
bufferOrStream = node_stream_1.Readable.fromWeb(data ?? new ReadableStream()); | ||
break; | ||
case 'json': | ||
setContentType('application/json'); | ||
bufferOrStream = Buffer.from(jsonBeautify ? JSON.stringify(data, null, 2) : JSON.stringify(data), charset); | ||
bufferOrStream = data === undefined | ||
? Buffer.from('', charset) | ||
: Buffer.from(jsonBeautify ? JSON.stringify(data, null, 2) : JSON.stringify(data), charset); | ||
break; | ||
case 'redirect': | ||
case 'redirect': // https://stackoverflow.com/a/8059718/1398479 | ||
res.setHeader('location', data); | ||
@@ -119,2 +121,2 @@ bufferOrStream = Buffer.from('', charset); | ||
exports.writeRes = writeRes; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHhIZWxwZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2R4SGVscGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFDQSw2Q0FBb0M7QUFDcEMsb0RBQThCO0FBQzlCLHlDQUFtQztBQUNuQyx1Q0FBZ0Q7QUFFaEQseURBQTJDO0FBQzNDLG1DQUE4QjtBQStDdkIsS0FBSyxVQUFVLFFBQVEsQ0FBQyxHQUFvQixFQUFFLEdBQW1CLEVBQUUsRUFBQyxJQUFJLEVBQUUsSUFBSSxFQUFF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FBTSxHQUFFLENBQUMsTUFBTSxDQUFDLEdBQUcsS0FBSyxDQUFBO1FBQ3hCLE1BQU0sQ0FBQyxJQUFBLGNBQU0sR0FBRSxFQUFFLElBQUEsY0FBTSxHQUFFLENBQUMsQ0FBQTtRQUMxQixNQUFNLEtBQUssQ0FBQyxPQUFPLENBQUEsQ0FBQyxzRUFBc0U7UUFDMUYsTUFBTSxJQUFJLEVBQUUsQ0FBQTtJQUNiLENBQUMsQ0FBQTtBQUNGLENBQUM7QUFkRCxzQ0FjQyJ9 |
export { getReq, getRes, setHtml, setNodeStream, setWebStream, setJson, setBuffer, setRedirect, setText, setFile, makeDxContext, } from './dx.js'; | ||
import { dxServer } from './dx.js'; | ||
export { getBuffer, getJson, getRaw, getText, getUrlEncoded, getQuery, } from './body.js'; | ||
export { router } from './route.js'; | ||
export { router } from './router.js'; | ||
export { connectMiddlewares } from './connect.js'; | ||
export { chainStatic } from './static.js'; | ||
export default dxServer; |
@@ -24,4 +24,4 @@ "use strict"; | ||
Object.defineProperty(exports, "getQuery", { enumerable: true, get: function () { return body_js_1.getQuery; } }); | ||
var route_js_1 = require("./route.js"); | ||
Object.defineProperty(exports, "router", { enumerable: true, get: function () { return route_js_1.router; } }); | ||
var router_js_1 = require("./router.js"); | ||
Object.defineProperty(exports, "router", { enumerable: true, get: function () { return router_js_1.router; } }); | ||
var connect_js_1 = require("./connect.js"); | ||
@@ -32,2 +32,2 @@ Object.defineProperty(exports, "connectMiddlewares", { enumerable: true, get: function () { return connect_js_1.connectMiddlewares; } }); | ||
exports.default = dx_js_2.dxServer; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsaUNBWWdCO0FBWGYsK0ZBQUEsTUFBTSxPQUFBO0FBQ04sK0ZBQ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0FBQ1Qsb0dBQUEsV0FBVyxPQUFBO0FBQ1gsZ0dBQUEsT0FBTyxPQUFBO0FBQ1AsZ0dBQUEsT0FBTyxPQUFBO0FBQ1Asc0dBQUEsYUFBYSxPQUFBO0FBRWQsbUNBQWdDO0FBQ2hDLHFDQU9rQjtBQU5qQixvR0FBQSxTQUFTLE9BQUE7QUFDVCxrR0FBQSxPQUFPLE9BQUE7QUFDUCxpR0FBQSxNQUFNLE9BQUE7QUFDTixrR0FBQSxPQUFPLE9BQUE7QUFDUCx3R0FBQSxhQUFhLE9BQUE7QUFDYixtR0FBQSxRQUFRLE9BQUE7QUFFVCx5Q0FBa0M7QUFBMUIsbUdBQUEsTUFBTSxPQUFBO0FBQ2QsMkNBQStDO0FBQXZDLGdIQUFBLGtCQUFrQixPQUFBO0FBQzFCLHlDQUF1QztBQUEvQix3R0FBQSxXQUFXLE9BQUE7QUFFbkIsa0JBQWUsZ0JBQVEsQ0FBQSJ9 |
@@ -20,21 +20,23 @@ import { Readable } from 'node:stream'; | ||
// shared with text | ||
bufferOrStream = Buffer.from(data, charset); | ||
bufferOrStream = Buffer.from(data ?? '', charset); | ||
break; | ||
case 'buffer': | ||
setContentType('application/octet-stream'); | ||
bufferOrStream = data; | ||
bufferOrStream = data ?? Buffer.from('', charset); | ||
break; | ||
case 'nodeStream': | ||
setContentType('application/octet-stream'); | ||
bufferOrStream = data; | ||
bufferOrStream = data ?? Buffer.from('', charset); | ||
break; | ||
case 'webStream': | ||
setContentType('application/octet-stream'); | ||
bufferOrStream = Readable.fromWeb(data); | ||
bufferOrStream = Readable.fromWeb(data ?? new ReadableStream()); | ||
break; | ||
case 'json': | ||
setContentType('application/json'); | ||
bufferOrStream = Buffer.from(jsonBeautify ? JSON.stringify(data, null, 2) : JSON.stringify(data), charset); | ||
bufferOrStream = data === undefined | ||
? Buffer.from('', charset) | ||
: Buffer.from(jsonBeautify ? JSON.stringify(data, null, 2) : JSON.stringify(data), charset); | ||
break; | ||
case 'redirect': | ||
case 'redirect': // https://stackoverflow.com/a/8059718/1398479 | ||
res.setHeader('location', data); | ||
@@ -112,2 +114,2 @@ bufferOrStream = Buffer.from('', charset); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHhIZWxwZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2R4SGVscGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUMsUUFBUSxFQUFDLE1BQU0sYUFBYSxDQUFBO0FBQ3BDLE9BQU8sU0FBUyxNQUFNLFFBQVEsQ0FBQTtBQUM5QixPQUFPLEVBQUMsU0FBUyxFQUFDLE1BQU0sV0FBVyxDQUFBO0FBQ25DLE9BQU8sRUFBQyxTQUFTLEVBQUUsV0FBVyxFQUFDLE1BQU0sV0FBVyxDQUFBO0FBRWhELE9BQU8sRUFBQyxRQUFRLEVBQUMsTUFBTSxvQkFBb0IsQ0FBQTtBQUMzQyxPQUFPLEVBQUMsTUFBTSxFQUFDLE1BQU0sU0FBUyxDQUFBO0FBK0M5QixNQUFNLENBQUMsS0FBSyxVQUFVLFFBQVEsQ0FBQyxHQUFvQixFQUFFLEdBQW1CLEVBQUUsRUFBQyxJQUFJLEVBQUUsSUFBSSxFQUFFLE9BQU8sRUFBRSxZQUFZLEVBQUUsV0FBVyxFQUFFLE9BQU8sRUFBWTtJQUM3SSxNQUFNLGNBQWMsR0FBRyxDQUFDLFdBQW1CLEVBQUUsRUFBRTtRQUM5QyxJQUFJLEdBQUcsQ0FBQyxXQUFXLElBQUksR0FBRyxDQUFDLFNBQVMsQ0FBQyxjQUFjLENBQUM7WUFBRSxPQUFNO1FBQzVELEdBQUcsQ0FBQyxTQUFTLENBQUMsY0FBYyxFQUFFLEdBQUcsV0FBVyxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsYUFBYSxPQUFPLEVBQUUsQ0FBQyxDQUFDLENB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UMxRixNQUFNLElBQUksRUFBRSxDQUFBO0lBQ2IsQ0FBQyxDQUFBO0FBQ0YsQ0FBQyJ9 |
export { getReq, getRes, setHtml, setNodeStream, setWebStream, setJson, setBuffer, setRedirect, setText, setFile, makeDxContext, } from './dx.js'; | ||
import { dxServer } from './dx.js'; | ||
export { getBuffer, getJson, getRaw, getText, getUrlEncoded, getQuery, } from './body.js'; | ||
export { router } from './route.js'; | ||
export { router } from './router.js'; | ||
export { connectMiddlewares } from './connect.js'; | ||
export { chainStatic } from './static.js'; | ||
export default dxServer; |
export { getReq, getRes, setHtml, setNodeStream, setWebStream, setJson, setBuffer, setRedirect, setText, setFile, makeDxContext, } from './dx.js'; | ||
import { dxServer } from './dx.js'; | ||
export { getBuffer, getJson, getRaw, getText, getUrlEncoded, getQuery, } from './body.js'; | ||
export { router } from './route.js'; | ||
export { router } from './router.js'; | ||
export { connectMiddlewares } from './connect.js'; | ||
export { chainStatic } from './static.js'; | ||
export default dxServer; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNOLE1BQU0sRUFDTixNQUFNLEVBQ04sT0FBTyxFQUNQLGFBQWEsRUFDYixZQUFZLEVBQ1osT0FBTyxFQUNQLFNBQVMsRUFDVCxXQUFXLEVBQ1gsT0FBTyxFQUNQLE9BQU8sRUFDUCxhQUFhLEdBQ2IsTUFBTSxTQUFTLENBQUE7QUFDaEIsT0FBTyxFQUFDLFFBQVEsRUFBQyxNQUFNLFNBQVMsQ0FBQTtBQUNoQyxPQUFPLEVBQ04sU0FBUyxFQUNULE9BQU8sRUFDUCxNQUFNLEVBQ04sT0FBTyxFQUNQLGFBQWEsRUFDYixRQUFRLEdBQ1IsTUFBTSxXQUFXLENBQUE7QUFDbEIsT0FBTyxFQUFDLE1BQU0sRUFBQyxNQUFNLFlBQVksQ0FBQTtBQUNqQyxPQUFPLEVBQUMsa0JBQWtCLEVBQUMsTUFBTSxjQUFjLENBQUE7QUFDL0MsT0FBTyxFQUFDLFdBQVcsRUFBQyxNQUFNLGFBQWEsQ0FBQTtBQUV2QyxlQUFlLFFBQVEsQ0FBQSJ9 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNOLE1BQU0sRUFDTixNQUFNLEVBQ04sT0FBTyxFQUNQLGFBQWEsRUFDYixZQUFZLEVBQ1osT0FBTyxFQUNQLFNBQVMsRUFDVCxXQUFXLEVBQ1gsT0FBTyxFQUNQLE9BQU8sRUFDUCxhQUFhLEdBQ2IsTUFBTSxTQUFTLENBQUE7QUFDaEIsT0FBTyxFQUFDLFFBQVEsRUFBQyxNQUFNLFNBQVMsQ0FBQTtBQUNoQyxPQUFPLEVBQ04sU0FBUyxFQUNULE9BQU8sRUFDUCxNQUFNLEVBQ04sT0FBTyxFQUNQLGFBQWEsRUFDYixRQUFRLEdBQ1IsTUFBTSxXQUFXLENBQUE7QUFDbEIsT0FBTyxFQUFDLE1BQU0sRUFBQyxNQUFNLGFBQWEsQ0FBQTtBQUNsQyxPQUFPLEVBQUMsa0JBQWtCLEVBQUMsTUFBTSxjQUFjLENBQUE7QUFDL0MsT0FBTyxFQUFDLFdBQVcsRUFBQyxNQUFNLGFBQWEsQ0FBQTtBQUV2QyxlQUFlLFFBQVEsQ0FBQSJ9 |
{ | ||
"name": "dx-server", | ||
"version": "0.5.6", | ||
"version": "0.5.7", | ||
"main": "./cjs/index.js", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/tranvansang/dx-server", |
115
README.md
@@ -45,3 +45,3 @@ # dx-server - modern, unopinionated, and satisfactory server | ||
import chain from 'jchain' | ||
import dxServer, {chainStatic, getReq, getRes, setHtml} from 'dx-server' | ||
import dxServer, {chainStatic, setHtml} from 'dx-server' | ||
import {resolve, dirname} from 'node:path' | ||
@@ -52,12 +52,2 @@ import {fileURLToPath} from 'node:url' | ||
dxServer(req, res), | ||
async next => { | ||
try { | ||
getRes().setHeader('Cache-Control', 'no-cache') | ||
console.log(getReq().method, getReq().url) | ||
await next() | ||
} catch (e) { | ||
console.error(e) | ||
setHtml('internal server error', {status: 500}) | ||
} | ||
}, | ||
chainStatic('/', {root: resolve(dirname(fileURLToPath(import.meta.url)), 'public')}), | ||
@@ -162,10 +152,4 @@ () => setHtml('not found', {status: 404}), | ||
}), | ||
router.get({ // sample GET router | ||
'/'() { | ||
setHtml('ok') | ||
}, | ||
'/health'() { | ||
setHtml('ok') | ||
} | ||
}), | ||
router.get('/', () => setHtml('ok')), // router.method() accepts 2 formats | ||
router.get('/health', () => setText('ok')), | ||
() => { // not found router | ||
@@ -195,3 +179,3 @@ throw new ServerError('not found', 404, 'not_found') | ||
`getBuffer, getJson, getRaw, getText, getUrlEncoded, getQuery` are all synchronous functions. | ||
`getBuffer, getJson, getRaw, getText, getUrlEncoded, getQuery` are all asynchronous functions. | ||
The associated results are calculated in the first time they are called and cached for subsequent calls. | ||
@@ -254,2 +238,11 @@ | ||
## Basic | ||
```javascript | ||
import dxServer, { | ||
getReq, getRes, getBuffer, getJson, getRaw, getText, getUrlEncoded, getQuery, | ||
setHtml, setJson, setText, setBuffer, setRedirect, setNodeStream, setWebStream, setFile, | ||
makeDxContext | ||
} from 'dx-server' | ||
``` | ||
- `getReq()`, `getRes()`: get request and response objects from anywhere. | ||
@@ -260,2 +253,3 @@ | ||
- `const json = await getJson()`: lazily load the context, once loaded, it is cached for subsequent calls. | ||
No chaining is required. | ||
- Chain it to get the value synchronously: `chain(getJson.chain(), next => console.log(getJson.value))`. Note that the value is calculated in every request. | ||
@@ -266,6 +260,2 @@ - `makeDxContext(fn)`: create a DX context object. | ||
- `router.get`, `router.post`, `router.put`, `router.delete`, `router.patch`, `router.head`, `router.options`, `router.connect`, `router.trace`: create router. | ||
- `router.method(methods, routes, options)`: create router with custom methods. | ||
- `router.all(routes, options)`: create router for all methods. | ||
- `connectMiddlewares(...middlewares)`: connect middlewares. For example: | ||
@@ -293,1 +283,78 @@ ```javascript | ||
``` | ||
## Routing | ||
```javascript | ||
import {router} from 'dx-server' | ||
``` | ||
- `router.get`, `router.post`, `router.put`, `router.delete`, `router.patch`, `router.head`, `router.options`, `router.connect`, `router.trace`: create router. | ||
These functions accept 2 formats: | ||
- `router.get(routes: {[pattern: string]: Route}, options: RouterOptions)`: create multiple routes. | ||
- `router.get(pattern: string, handler: Route, options: RouterOptions)`: create route for GET method. | ||
- `router.all(...)`: same as `router.get()` but for any method. | ||
- `router.method()`: create router with custom method. Similar to `router.get()`, this function accepts 2 formats. | ||
- `router.method(method: string, routes: {[pattern: string]: Route}, options: RouterOptions)`: create multiple routes. | ||
- `router.method(method: string, pattern: string, handler: Route, options: RouterOptions)`: create route for `method` method. | ||
`RouterOptions` is defined as follows: | ||
```typescript | ||
interface RegexpToPathOptions { | ||
end?: boolean // default true. match till end of string | ||
strict?: boolean // default false. disallow trailing delimiter | ||
sensitive?: boolean // default false | ||
start?: boolean // default true. match from beginning of string | ||
delimiter?: string // default '/#?'. delimiter for segments | ||
endsWith?: string // default undefined. optional character that matches at the end of the string | ||
encode?(value: string): string // default x => x. encode strings before inserting into RegExp | ||
prefixes?: string // default `./`. List of characters to automatically consider prefixes when parsing. | ||
} | ||
interface RouterOptions extends RegexpToPathOptions { | ||
prefix?: string | ||
} | ||
``` | ||
`options: RegexpToPathOptions` (except `prefix` key) is directly passed to [path-to-regexp](https://www.npmjs.com/package/path-to-regexp) package. | ||
`Route` is defined as follows: | ||
```typescript | ||
interface RouteContext { | ||
matched: string | ||
params: Record<string, string> | ||
next(): any | ||
} | ||
type Route = (context: RouteContext) => any | ||
``` | ||
## Helpers | ||
```javascript | ||
import { | ||
setBufferBodyDefaultOptions, | ||
bufferFromReq, jsonFromReq, rawFromReq, textFromReq, urlEncodedFromReq, queryFromReq, | ||
} from 'dx-server/helpers' | ||
``` | ||
Helpers are all pure functions, and do not rely on any context. | ||
These functions are independent of the context and can be used anywhere, even outside of this package. | ||
They require request and response objects to be passed. | ||
## ExpressJS | ||
```javascript | ||
import {expressApp, expressRouter} from 'dx-server/express' // requires express installed | ||
chain( | ||
await expressApp(app => {// any express feature can be used. This requires express installed, with for e.g., `yarn add express` | ||
app.set('trust proxy', true) | ||
if (process.env.NODE_ENV !== 'production') app.set('json spaces', 2) | ||
app.use('/public', express.static('public')) | ||
}), | ||
expressRouter(router => { | ||
router.use(cors()) | ||
}), | ||
) | ||
``` | ||
## Other functionalities | ||
- Download file: set the [Content-Disposition](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) header. | ||
- Upload file: recommend [busboy](https://www.npmjs.com/package/busboy) package. | ||
- Cookie: recommend [cookie](https://www.npmjs.com/package/cookie) 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
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
176826
2102
353