Socket
Socket
Sign inDemoInstall

@orion-js/http

Package Overview
Dependencies
Maintainers
2
Versions
76
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.6 to 3.0.7

16

lib/routes/route.test.js

@@ -78,2 +78,18 @@ "use strict";

});
test('It should handle a http request of type get and post on the same path', async () => {
const testRoute = (0, route_1.default)({
path: '/test6',
method: 'all',
async resolve(req, res, viewer) {
return { body: 'hello world', statusCode: 200 };
}
});
(0, registerRoute_1.default)(testRoute);
const response = await (0, supertest_1.default)(app).get('/test6');
expect(response.statusCode).toBe(200);
expect(response.text).toBe('hello world');
const response2 = await (0, supertest_1.default)(app).post('/test6');
expect(response2.statusCode).toBe(200);
expect(response2.text).toBe('hello world');
});
});

8

lib/types.d.ts

@@ -11,3 +11,9 @@ import express from 'express';

export interface OrionRouteOptions {
method: 'get' | 'post' | 'put' | 'delete';
/**
* The http method of the requests to match.
*/
method: 'get' | 'post' | 'put' | 'delete' | 'all';
/**
* The path of the requests to match.
*/
path: string;

@@ -14,0 +20,0 @@ /**

8

package.json
{
"name": "@orion-js/http",
"version": "3.0.6",
"version": "3.0.7",
"main": "lib/index.js",

@@ -20,4 +20,4 @@ "types": "lib/index.d.ts",

"@orion-js/helpers": "^3.0.0",
"@orion-js/resolvers": "^3.0.6",
"@orion-js/schema": "^3.0.0",
"@orion-js/resolvers": "^3.0.7",
"@orion-js/schema": "^3.0.7",
"body-parser": "1.19.0",

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

},
"gitHead": "91b207f9f7afa418177b5aeace2e5f9b0a0ef04d"
"gitHead": "1eb98fb22afbccb18f25b7f895b895b6b68bbfd4"
}
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