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
36
votes
12 answers

Is middleware neeeded to redirect to HTTPS in ASP.net and C#?

What is the recommend way to redirect to HTTPS all incoming requests that are not secure. Do I need to write a middleware component? If so, I couldn't figure out how to get the server name. public class RedirectHttpMiddleware { RequestDelegate…
William
  • 1,354
  • 3
  • 13
  • 18
35
votes
5 answers

Get ordered list of middleware in a generic rack application?

The functionality I am looking for is similar to the rake middleware command in Rails, except for a generic rack application.
Buzzy
  • 3,618
  • 4
  • 30
  • 41
35
votes
9 answers

Grouping routes in Express

We can group our routes like this in Laravel: Route::group("admin", ["middleware" => ["isAdmin"]], function () { Route::get("/", "AdminController@index"); Route::post("/post", ["middleware" => "csrf", "uses" =>…
Aris
  • 2,978
  • 5
  • 22
  • 31
34
votes
3 answers

Laravel 5 Function () not found

I'm putting together a site which has a protected section where users must be logged in to access. I've done this in Laravel 4 without too much incident. However, for the life of me I cannot figure out why I can't get it to work in Laravel 5(L5). In…
joseph
  • 454
  • 1
  • 5
  • 12
32
votes
1 answer

Why middleware mixin declared in django.utils.deprecation.py

in path django.utils.deprecation.py we have some class about deprecation warning for methods. in that file we have a class called MiddlewareMixin. this class used to write middleware classes. Although not related to deprecation, Why this class wrote…
vorujack
  • 1,778
  • 16
  • 22
32
votes
3 answers

NodeJS + Express: How to secure a URL

I am using latest versions of NodeJS and ExpressJS (for MVC). I usually configure my rest paths like this, for example: app.get('/archive', routes.archive); Now i want my /admin/* set of URLs to be secured, I mean I need just simple…
Fabio B.
  • 9,138
  • 25
  • 105
  • 177
31
votes
2 answers

express global middleware not being called

As far as I can tell I'm configuring my global middleware function as described in the docs and in every forum post on the subject, but it is not being called. Does anyone see what I'm doing wrong? express 3.2.5. In the log output I see the…
Jake
  • 2,852
  • 7
  • 32
  • 39
30
votes
1 answer

Flask middleware for specific route

I made API Server with Python Flask-RESTful. My system use token authentication for verify permission. So, I added middleware for verify token. For example, code like this, [middleware.py] class Test(object): def __init__(self, app): …
Hide
  • 3,199
  • 7
  • 41
  • 83
29
votes
2 answers

How to put middleware in it's own file in Node.js / Express.js

I am new to the whole Node.js thing, so I am still trying to get the hang of how things "connect". I am trying to use the express-form validation. As per the docs you can do app.post( '/user', // Route form( // Form filter and validation…
danneth
  • 2,721
  • 1
  • 23
  • 31
28
votes
4 answers

How to respond via an JsonResult from Asp.Net Core middleware?

I would like to respond via a JsonResult from a piece of Asp.Net Core middleware but it's not obvious how to accomplish that. I have googled around alot but with little success. I can respond via a JsonResult from a global IActionFilter by setting…
RonC
  • 31,330
  • 19
  • 94
  • 139
28
votes
3 answers

Gulp browser-sync - redirect API request via proxy

I'm trying to redirect my API requests like this with gulp and browser-sync: gulp.task('browser-sync', function () { var files = [ '../index.html', '../views/**/*.html', '../assets/css/**/*.css', '../assets/js/**/*.js' …
alskaa
  • 394
  • 1
  • 3
  • 14
27
votes
2 answers

React App - createProxyMiddleware is not a function

I am working on a react project and am running into some issues with http-proxy-middleware. I followed the readme and my setupProxy.js file looks like this const {createProxyMiddleware} = require('http-proxy-middleware'); module.exports =…
otmaka
  • 316
  • 1
  • 3
  • 5
27
votes
2 answers

ASP.NET Core Middleware Passing Parameters to Controllers

I am using ASP.NET Core Web API, where I have Multiple independent web api projects. Before executing any of the controllers' actions, I have to check if the the logged in user is already impersonating other user (which i can get from DB) and can…
26
votes
5 answers

What is the difference between an API, a framework and middleware?

What's the difference between an API, a framework and middleware? Essentially, all of them provide abstract low level services to apps. In that case, why is dot net called a framework and windows API called, well... an API?
Laz
  • 6,036
  • 10
  • 41
  • 54
26
votes
2 answers

Pass data to middleware further down the chain

When I register middleware as part of the request pipeline, how do I pass data through the middleware chain. (ultimately accessible in an MVC controller action) For example, I have implemented custom middleware for authenticating my requests, but…
Warrick
  • 1,623
  • 1
  • 17
  • 20