New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

forcedomain

Package Overview
Dependencies
Maintainers
3
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

forcedomain - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

.releaserc.json

16

package.json
{
"name": "forcedomain",
"version": "2.0.1",
"version": "2.1.0",
"description": "forcedomain is a middleware for Connect and Express that redirects any requests to a default domain.",

@@ -47,12 +47,14 @@ "contributors": [

],
"main": "lib/forceDomain.js",
"main": "build/lib/forceDomain.js",
"types": "build/lib/forceDomain.d.ts",
"dependencies": {
"lodash": "4.17.20"
"@types/express": "4.17.8",
"express": "4.17.1"
},
"devDependencies": {
"@types/supertest": "2.0.10",
"assertthat": "5.2.1",
"cases": "1.0.0",
"express": "4.17.1",
"roboter": "11.2.25",
"supertest": "4.0.2"
"roboter": "11.3.14",
"semantic-release-configuration": "1.0.21",
"supertest": "5.0.0"
},

@@ -59,0 +61,0 @@ "repository": {

@@ -5,2 +5,12 @@ # forcedomain

## Status
| Category | Status |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| Version | [![npm](https://img.shields.io/npm/v/forcedomain)](https://www.npmjs.com/package/forcedomain) |
| Dependencies | ![David](https://img.shields.io/david/thenativeweb/forcedomain) |
| Dev dependencies | ![David](https://img.shields.io/david/dev/thenativeweb/forcedomain) |
| Build | ![GitHub Actions](https://github.com/thenativeweb/forcedomain/workflows/Release/badge.svg?branch=master) |
| License | ![GitHub](https://img.shields.io/github/license/thenativeweb/forcedomain) |
## Installation

@@ -14,10 +24,16 @@

The first thing you need to do is to integrate forcedomain into your application. For that add a reference to the `forcedomain` module.
The first thing you need to do is to integrate forcedomain into your application. For that add a reference to the `forcedomain` module:
```javascript
const forceDomain = require('forcedomain');
const { forceDomain } = require('forcedomain');
```
If you now want to redirect your requests to a specific host, include the middleware and configure it accordingly.
If you use TypeScript, use the following code instead:
```typescript
import { forcedomain } from 'forcedomain';
```
If you now want to redirect your requests to a specific host, include the middleware and configure it accordingly:
```javascript

@@ -29,3 +45,3 @@ app.use(forceDomain({

Additionally, you can also specify a port and a target protocol.
Additionally, you can also specify a port and a target protocol:

@@ -42,3 +58,3 @@ ```javascript

If you want to use a `temporary` redirect instead, specify it as redirection type.
If you want to use a `temporary` redirect instead, specify it as redirection type:

@@ -52,3 +68,3 @@ ```javascript

You can use `excludeRule` to disable redirect based on a regular expression.
You can use `excludeRule` to disable redirect based on a regular expression:

@@ -68,10 +84,12 @@ ```javascript

server {
// ...
```
server {
// ...
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $http_host;
}
}
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $http_host;
}
}
```

@@ -85,12 +103,1 @@ ## Running the build

```
## License
The MIT License (MIT)
Copyright (c) 2013-2019 the native web.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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