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

hydra-express

Package Overview
Dependencies
Maintainers
1
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hydra-express - npm Package Compare versions

Comparing version 1.2.10 to 1.2.12-experimental

21

index.js

@@ -23,3 +23,4 @@ /**

const ServerResponse = require('fwsp-server-response');
const hydra = require('hydra');
const ServerResponse = hydra.getServerResponse();
let serverResponse = new ServerResponse();

@@ -39,9 +40,3 @@

const jwtAuth = require('fwsp-jwt-auth');
const hydra = require('hydra');
const HTTP_OK = 200;
const HTTP_UNAUTHORIZED = 401;
const HTTP_NOT_FOUND = 404;
const HTTP_SERVER_ERROR = 500;
let app = express();

@@ -513,3 +508,3 @@

let err = new Error('Not Found');
err.status = HTTP_NOT_FOUND;
err.status = ServerResponse.HTTP_NOT_FOUND;
next(err);

@@ -525,4 +520,4 @@ });

app.use((err, req, res, _next) => {
let errCode = err.status || HTTP_SERVER_ERROR;
if (err.status !== HTTP_NOT_FOUND) {
let errCode = err.status || ServerResponse.HTTP_SERVER_ERROR;
if (err.status !== ServerResponse.HTTP_NOT_FOUND) {
this.appLogger.fatal({

@@ -590,3 +585,3 @@ event: 'error',

if (!authHeader) {
this.sendResponse(HTTP_UNAUTHORIZED, res, {
this.sendResponse(ServerResponse.HTTP_UNAUTHORIZED, res, {
result: {

@@ -605,3 +600,3 @@ reason: 'Invalid token'

.catch((err) => {
this.sendResponse(HTTP_UNAUTHORIZED, res, {
this.sendResponse(ServerResponse.HTTP_UNAUTHORIZED, res, {
result: {

@@ -613,3 +608,3 @@ reason: err.message

} else {
this.sendResponse(HTTP_UNAUTHORIZED, res, {
this.sendResponse(ServerResponse.HTTP_UNAUTHORIZED, res, {
result: {

@@ -616,0 +611,0 @@ reason: 'Invalid token'

{
"name": "hydra-express",
"version": "1.2.10",
"version": "1.2.12-experimental",
"description": "A module which wraps Hydra and ExpressJS to provide an out of the box microservice which can support API routes and handlers.",

@@ -45,6 +45,5 @@ "author": {

"express": "4.15.2",
"hydra": "1.2.10",
"hydra": "1.2.12-experimental",
"fwsp-jsutils": "1.0.10",
"fwsp-jwt-auth": "0.0.8",
"fwsp-server-response": "2.2.6",
"helmet": "3.5.0",

@@ -51,0 +50,0 @@ "moment": "2.18.1",

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