Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nlbridge/server

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nlbridge/server - npm Package Compare versions

Comparing version 0.2.5 to 0.2.6

2

cjs/nlbridge-server.js

@@ -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(""+n+""),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(""+n+""),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(""+n+""),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(""+n+""),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(""+t+""),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(""+t+""),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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc