New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

express-origin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-origin

express module that adds origin to req

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

Useless

This package is useless, you can do what it does simply by adding / before file path. Watch this video to see an example:

Access files in root from children route

Install

npm i express-origin --save

Usage

var express = require('express');
var expressOrigin = require('express-origin');

var app = express();
app.use(expressOrigin());

Now You have:

app.get('/article/sport/:id',function (req, res, next) {
    // req.origin = /../../..
})

You can pass it to views to make paths relative to your domain name, Eg:

script(src= req.origin + "/js/main.js")

Will Give:

<script src="www.example.com/js/main.js" ></script>

Keywords

express

FAQs

Package last updated on 18 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts