@nlbridge/server
Advanced tools
Comparing version 0.2.5 to 0.2.6
@@ -1,1 +0,1 @@ | ||
"use strict";var e=require("@nlbridge/express"),r=require("express");exports.createServer=s=>{const t=r();t.use(r.json({})),t.use(r.urlencoded({extended:!1}));const n=s.cors??"*";t.use(((e,r,s)=>{r.header("Access-Control-Allow-Origin",n),r.header("Access-Control-Allow-Headers","Origin, X-Requested-With, Content-Type, Accept"),s()})),t.use(((e,r,s,t)=>{var n;if(n=e,console.error("[31m"+n+"[0m"),e instanceof SyntaxError)return s.status(400).send({status:404,message:e.message});s.status(500).send("Internal server error.")}));const o=s.endpoint?s.endpoint.startsWith("/")?s.endpoint:`/${s.endpoint}`:"/";return t.post(o,e.middleware(s.api,{apiKey:s.apiKey})),t}; | ||
"use strict";var e=require("@nlbridge/express"),r=require("express");exports.createServer=s=>{const t=r();t.use(r.json({})),t.use(r.urlencoded({extended:!1}));const n=s.cors??"*";t.use(((e,r,s)=>{r.header("Access-Control-Allow-Origin",n),r.header("Access-Control-Allow-Headers","Origin, X-Requested-With, Content-Type, Accept"),s()})),t.use(((e,r,s,t)=>{var n;if(n=e,console.error("[31m"+n+"[0m"),e instanceof SyntaxError)return s.status(400).send({status:404,message:e.message});s.status(500).send("Internal server error.")}));const o=s.endpoint?s.endpoint.startsWith("/")?s.endpoint:`/${s.endpoint}`:"/",a=e.defaultMiddleware(s.api,s);return t.post(o,a),t}; |
@@ -1,1 +0,1 @@ | ||
import{middleware as e}from"@nlbridge/express";import s from"express";const r=r=>{const t=s();t.use(s.json({})),t.use(s.urlencoded({extended:!1}));const n=r.cors??"*";t.use(((e,s,r)=>{s.header("Access-Control-Allow-Origin",n),s.header("Access-Control-Allow-Headers","Origin, X-Requested-With, Content-Type, Accept"),r()})),t.use(((e,s,r,t)=>{var n;if(n=e,console.error("[31m"+n+"[0m"),e instanceof SyntaxError)return r.status(400).send({status:404,message:e.message});r.status(500).send("Internal server error.")}));const o=r.endpoint?r.endpoint.startsWith("/")?r.endpoint:`/${r.endpoint}`:"/";return t.post(o,e(r.api,{apiKey:r.apiKey})),t};export{r as createServer}; | ||
import{defaultMiddleware as e}from"@nlbridge/express";import s from"express";const r=r=>{const t=s();t.use(s.json({})),t.use(s.urlencoded({extended:!1}));const n=r.cors??"*";t.use(((e,s,r)=>{s.header("Access-Control-Allow-Origin",n),s.header("Access-Control-Allow-Headers","Origin, X-Requested-With, Content-Type, Accept"),r()})),t.use(((e,s,r,t)=>{var n;if(n=e,console.error("[31m"+n+"[0m"),e instanceof SyntaxError)return r.status(400).send({status:404,message:e.message});r.status(500).send("Internal server error.")}));const o=r.endpoint?r.endpoint.startsWith("/")?r.endpoint:`/${r.endpoint}`:"/",i=e(r.api,r);return t.post(o,i),t};export{r as createServer}; |
{ | ||
"name": "@nlbridge/server", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"description": "A quick spin-up HTTTP server for dev and testing using @nlbridge/express", | ||
@@ -59,3 +59,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@nlbridge/express": "0.2.5", | ||
"@nlbridge/express": "0.2.6", | ||
"express": "^4.18.2" | ||
@@ -62,0 +62,0 @@ }, |
@@ -1,1 +0,1 @@ | ||
!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@nlbridge/express"),require("express")):"function"==typeof define&&define.amd?define(["exports","@nlbridge/express","express"],s):s((e="undefined"!=typeof globalThis?globalThis:e||self)["@nlbridge/server"]={},e.express$1,e.express)}(this,(function(e,s,r){"use strict";e.createServer=e=>{const n=r();n.use(r.json({})),n.use(r.urlencoded({extended:!1}));const t=e.cors??"*";n.use(((e,s,r)=>{s.header("Access-Control-Allow-Origin",t),s.header("Access-Control-Allow-Headers","Origin, X-Requested-With, Content-Type, Accept"),r()})),n.use(((e,s,r,n)=>{var t;if(t=e,console.error("[31m"+t+"[0m"),e instanceof SyntaxError)return r.status(400).send({status:404,message:e.message});r.status(500).send("Internal server error.")}));const o=e.endpoint?e.endpoint.startsWith("/")?e.endpoint:`/${e.endpoint}`:"/";return n.post(o,s.middleware(e.api,{apiKey:e.apiKey})),n}})); | ||
!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@nlbridge/express"),require("express")):"function"==typeof define&&define.amd?define(["exports","@nlbridge/express","express"],s):s((e="undefined"!=typeof globalThis?globalThis:e||self)["@nlbridge/server"]={},e.express$1,e.express)}(this,(function(e,s,r){"use strict";e.createServer=e=>{const n=r();n.use(r.json({})),n.use(r.urlencoded({extended:!1}));const t=e.cors??"*";n.use(((e,s,r)=>{s.header("Access-Control-Allow-Origin",t),s.header("Access-Control-Allow-Headers","Origin, X-Requested-With, Content-Type, Accept"),r()})),n.use(((e,s,r,n)=>{var t;if(t=e,console.error("[31m"+t+"[0m"),e instanceof SyntaxError)return r.status(400).send({status:404,message:e.message});r.status(500).send("Internal server error.")}));const o=e.endpoint?e.endpoint.startsWith("/")?e.endpoint:`/${e.endpoint}`:"/",i=s.defaultMiddleware(e.api,e);return n.post(o,i),n}})); |
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
11466
+ Added@nlbridge/core@0.2.6(transitive)
+ Added@nlbridge/express@0.2.6(transitive)
- Removed@nlbridge/core@0.2.5(transitive)
- Removed@nlbridge/express@0.2.5(transitive)
Updated@nlbridge/express@0.2.6