🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

koa-no-slash

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

koa-no-slash

Koa middleware removing trailing slash from paths.

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
2K
-9.14%
Maintainers
1
Weekly downloads
 
Created
Source

koa-no-slash

Koa middleware removing trailing slash from path.

Requirements

  • nodejs v14+
  • add type=module in your package.json as middleware is exported as ESM

Usage

Install:

yarn add koa-no-slash

Usage:

import http from 'http';
import koa from 'koa';
import noslash from 'koa-no-slash';

const app = new koa()
app.use(noslash());
app.use(ctx => ctx.body = ctx.path);

const server = http
    .createServer(app.callback())
    .listen(80, console.log);

FAQs

Package last updated on 29 Jun 2021

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