krasimir / view-source

An Express.js middleware/handler to render source code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

view-source

view-source

An Express.js add-on to render source code. Use it if you need to show source code of a project over the web.

Usage

Install it via npm i view-source (or yarn add view-source). Then the following:

const express = require('express');
const { viewSource } = require('view-source');

const app = express();

viewSource({
  appTitle: 'My App Name',
  app,
  route: '/code',
  source: __dirname + '/../'
});

Where route is the path from which you'll access the viewer and source is the actual physical place where the files are located.

About

An Express.js middleware/handler to render source code

License:MIT License


Languages

Language:JavaScript 100.0%