@orion-js/http
Advanced tools
Comparing version 3.0.6 to 3.0.7
@@ -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'); | ||
}); | ||
}); |
@@ -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 @@ /** |
{ | ||
"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" | ||
} |
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
20225
463
Updated@orion-js/resolvers@^3.0.7
Updated@orion-js/schema@^3.0.7