Questions tagged [middleware]

Middleware is computer software that provides services to software applications beyond those available from the operating system. It can be described as "software glue".

Middleware is a software component (or components) that sits "in the middle" between applications and the operating system. Typically, middleware will facilitate application development by providing services such as communications, file access, or thread locking that have a common Application Programming Interface (API) across multiple operating systems.

Communications Middleware is a specific kind of middleware that allows for interprocess communications (on one machine or across a network). The purpose of Communications Middleware is to simplify the designing, programming, and managing of software applications by streamlining the way these applications receive and process data. Communications Middleware simplifies writing communications software while providing sophisticated built-in features, reducing development costs.

Examples of communications middleware include:

4333 questions
1
vote
0 answers

Why Error handling middleware does not work in asp

I have problem with my simple app error handling middleware... When I tampered sql connect string, I get error but my middleware not catch it... someone know why? { public class ErrorHandlingMiddleware : IMiddleware // we need to add it to tell…
ruddnisrus
  • 187
  • 5
1
vote
1 answer

HTTP Middleware and Google Cloud Functions

What’s the equivalent to middleware handlers in Google Cloud Functions? In standard approach, normally I do: router.Handle("/receive", middlewares.ErrorHandler(MyReceiveHandler)) And then, in the middleware: type ErrorHandler…
1
vote
0 answers

NextJS Custom Server with ExpressJS, infinite call for middleware

I'm trying to create a custom server in NextJS with ExpressJS. First i tried to create routes, it goes so well. Next i tried to create a middleware and set it as application-level middleware, here's the middleware: const mymiddleware = (req, res,…
Elon Conner
  • 11
  • 1
  • 2
1
vote
1 answer

Nuxt middleware not triggered upon initial render

The following code is meant to check the role of the user. The middleware runs everytime the site is reloaded are a new route is taken. // Some nuxt middleware import * as firebase from 'firebase/app' import 'firebase/auth' export default function…
Marcel Klein
  • 117
  • 1
  • 1
  • 9
1
vote
1 answer

Running Nuxt middleware client side after static rendering

We're switching from SPA to statically generated, and are running into a problem with middleware. Basically, when Nuxt is statically rendered, middleware is run on the build server first, and then is run after each page navigation client side. The…
HMilbradt
  • 3,980
  • 16
  • 31
1
vote
0 answers

Use multiple middleware for multiple authentication in ExpressJS

I have 2 authentication systems. They was implemented in auth1 middleware, and auth2 middleware. They look like: // service1 for auth1 and service2 for auth2 let authInfo = service1.check(username, password); if (authInfo) { req.user =…
1
vote
1 answer

Nuxt serverMiddleware redirect is not a function

I want to redirect in serverMiddleware for one route and it says redirect is not a function code: export default function (req, res, next) { // req is the Node.js http request object const vuex = req.headers.cookie.slice(5); if…
Hasan Parasteh
  • 431
  • 8
  • 25
1
vote
1 answer

Best way of building middleware for intercepting requests in Django-Vuejs project

I'm working on a Django-Vuejs based project. In my project, a user can have a folder. Inside that, he can create multiple files. Let say, user restricted users from India to access that folder. This folder restriction will now be followed in files…
Prachi Sharma
  • 331
  • 1
  • 5
  • 14
1
vote
1 answer

'Forbidden' response when running middleware with WSGI-Kerberos

For a web-application I am writing a middleware using the WSGI-Kerberos to handle the authentication. In general these efforts intend to implement the Single Sign-On technology. So, users that are logged/active in the Active Directory would get an…
Taras
  • 266
  • 6
  • 23
1
vote
1 answer

Create middleware in mvc 5 (not core)

I have a simple ASP.NET MVC 5 (not .NET Core) project in which I want to create a simple middleware like we do in .NET Core: public class CustomMiddleware { internal const string HeaderKey = "RelationId"; private readonly…
Ask
  • 3,076
  • 6
  • 30
  • 63
1
vote
3 answers

Why this route is working in express when not defined anywhere?

I'm new to express and stuck in a problem while following some tutorial. The problem is why this URL http://localhost:8000/user/profile is working? I haven't defined any route for /user/profile. If possible a deep explanation on this. How is this…
1
vote
0 answers

http proxy middleware not working with create-react-app

This is my middleware file known as setupProxy.js. I have my express server running on port 5000, I also have my app using '/todos'; const { createProxyMiddleware } = require('http-proxy-middleware'); module.exports = function(app) { …
Shooting Stars
  • 755
  • 1
  • 9
  • 20
1
vote
2 answers

How Laravel middleware auth:api detect token from cookie?

I just trying to makes my auth flow more secure using a cookie on Laravel 5.7 Here my code /** * auth logic */ return response()->json(["status" => "logged in"], 200)->cookie('token', $token, $lifetime); Then the cookie will be saved on the…
Rizal Yogi Pratama
  • 117
  • 1
  • 1
  • 9
1
vote
1 answer

where should i place the middleware nodejs

**app.get('/', (req,res)=>{ res.send('Api is running...'); }) app.use('/api/products/', productRoutes); app.use(notFound); app.use(errorHandler);** Above is the gist of my code where app.use(notFound) and app.use(errorHandler) are…
1
vote
1 answer

Asp.Net Core 5 auth middleware occurring out of order specified in Configure

I have an asp.net core 5 app. Recently I have needed to write custom middleware to set a per-request variable (globalization data for adjusting dates). To set this variable, I need to request information from the database using a ProjectId key -…
statler
  • 1,322
  • 2
  • 15
  • 24