@intothesource/express-csv-redirect-middleware
v1.3.0
Published
ExpressJS Middleware that handles redirects from a CSV file
Downloads
4
Readme
express-csv-redirect-middleware
ExpressJS Middleware that handles redirects from a CSV file
Example
foo.csv
:
/foo/ 307 /bar/
/foo/ 307 /
/foo/ 410
server.js
:
import { readFileSync } from 'fs'
import { join } from 'path'
import express from 'express'
import csvRedirectMiddleware from '@intothesource/express-csv-redirect-middleware'
const csv = readFileSync(join(__dirname, 'foo.csv'))
const app = express()
app.use(csvRedirectMiddleware(csv))