# exprssi

> An NodeJS Express SSI Middleware

Latest version **0.5.1** (published 2017-05-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install exprssi
pnpm add exprssi
yarn add exprssi
bun add exprssi
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.1 |
| Published | 2017-05-11 |
| First published | 2017-05-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Stijn Van Wijmeersch |
| Maintainers | stino |
| Keywords | express, nodejs, SSI, middleware, shtml, Server, Side, Include |

## Links

- npm: https://www.npmjs.com/package/exprssi
- Repository: https://github.com/Stinobe/exprssi
- Homepage: https://github.com/Stinobe/exprssi#readme
- Issues: https://github.com/Stinobe/exprssi/issues
- npm.io page: https://npm.io/package/exprssi

## Dependencies (2)

- [defaults](https://npm.io/package/defaults.md) ^1.0.3
- [node-ssi](https://npm.io/package/node-ssi.md) ^0.3.2

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 0.5.1 (latest) — 2017-05-11
- 0.5.0 — 2017-05-03

## README

# ExprSSI
(SSI) Server Side Includes middleware for Express.

After some issues with virtual paths I've decided to create my own SSI middleware for [Express](http://expressjs.com/).

## Install
```
$ npm i exprssi --save
```

## Configuration
In this section I'll explain 3 possible ways to implement this middleware. Most of it is basically the same. The difference is in the [Express](http://expressjs.com/) setup.

### Working on the root
In this case we'll be working on the root of our project, nothing fancy.
```
// Load NMP Packages
const express = require( 'express' ),
      exprSSI = require( 'exprssi' );

// Create the Express instance
const app = express();

// Bind Exprssi middleware
app.use( exprSSI({
  baseDir: 'path/to/your/ssi/files'
}));
```

### Working with a static directory
Here we're telling [Express](http://expressjs.com/) that we'll be serving our file from a static directory. In this case we'll call the static directory ```public```.
```
// Load NMP Packages
const express = require( 'express' ),
      exprSSI = require( 'exprssi' );

// Create the Express instance
const app = express();

// Setup static directory
app.use( express.static( './public' ) );

// Bind Exprssi middleware
app.use( exprSSI({
  baseDir: 'path/to/your/ssi/files'
}));
```

### Working with virtual paths
This is where I encouterd my problem with existing SSI middlewares. So let's quickly fix this. We'll rout calls to ```exprssi/api``` to the directory ```public```.
```
// Load NMP Packages
const express = require( 'express' ),
      exprSSI = require( 'exprssi' );

// Create the Express instance
const app = express();

// Setup static directory
app.use( '/express/api', express.static( './public' ) );

// Bind Exprssi middleware
app.use( exprSSI({
  baseDir: 'path/to/your/ssi/files',
  virtual: '/expressi/api'
}));
```
> Note: It might be interesting to store the path ```/express/api``` in a variable.

## Options

Option | Description | Default
-------|-------------|--------
baseDir | Path to your shtml files | '.'
ext | The extension you wish to target | '.shtml'
payload | Content you would like to send when compiling | ''
virtual | The virtual path you're using | ```false```

## Changelog

* __V0.5.1:__
  * Remove URL parameters from request
  * Remove anchor links from request

---
_Source: https://npm.io/package/exprssi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
