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

@orion-js/http

Package Overview
Dependencies
Maintainers
2
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orion-js/http - npm Package Compare versions

Comparing version 3.0.0-alpha.20 to 3.0.0-alpha.23

2

lib/routes/registerRoute.js

@@ -26,3 +26,3 @@ "use strict";

function registerRoute(route) {
const app = (0, start_1.getApp)();
const app = route.app || (0, start_1.getApp)();
const method = route.method;

@@ -29,0 +29,0 @@ const handler = async (req, res) => {

@@ -8,3 +8,3 @@ "use strict";

const express_1 = __importDefault(require("express"));
const appRef = {};
global.appRef = null;
const startServer = (port = Number(process.env.PORT)) => {

@@ -17,8 +17,8 @@ const app = (0, exports.getApp)();

const getApp = () => {
if (appRef.app)
return appRef.app;
if (global.appRef)
return global.appRef;
const app = (0, express_1.default)();
appRef.app = app;
global.appRef = app;
return app;
};
exports.getApp = getApp;

@@ -28,4 +28,8 @@ import express from 'express';

resolve: (req: express.Request, res: express.Response, viewer: any) => Promise<RouteResponse> | Promise<void>;
/**
* Pass another express app
*/
app?: express.Application;
}
export interface Route extends OrionRouteOptions {
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setGetViewer = exports.getViewer = void 0;
let getViewerRef = () => null;
global.getViewerRef = () => null;
const getViewer = async (req) => {
try {
const viewer = await getViewerRef(req);
const viewer = await global.getViewerRef(req);
if (!viewer)

@@ -18,4 +18,4 @@ return {};

const setGetViewer = (getViewerFunc) => {
getViewerRef = getViewerFunc;
global.getViewerRef = getViewerFunc;
};
exports.setGetViewer = setGetViewer;
{
"name": "@orion-js/http",
"version": "3.0.0-alpha.20",
"version": "3.0.0-alpha.23",
"main": "lib/index.js",

@@ -19,5 +19,5 @@ "types": "lib/index.d.ts",

"dependencies": {
"@orion-js/helpers": "^3.0.0-alpha.11",
"@orion-js/resolvers": "^3.0.0-alpha.20",
"@orion-js/schema": "^3.0.0-alpha.13",
"@orion-js/helpers": "^3.0.0-alpha.23",
"@orion-js/resolvers": "^3.0.0-alpha.23",
"@orion-js/schema": "^3.0.0-alpha.23",
"body-parser": "1.19.0",

@@ -42,3 +42,3 @@ "express": "4.17.1"

},
"gitHead": "145e17f5a9d6bbf02f166c5faa416be60752a42f"
"gitHead": "3a2082794e3b1a8748a5aace8d68e5c18a92b707"
}
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