local-routes

1.0.4 • Public • Published

local-routes

npm installnfo

Table of contents

About

local-routes is a package that allows access to the localhost using directory-based routes simply and quickly.

Installation

Node.js v14.16.1 or newer is recommended.

Install: npm install local-routes

Example usage

Example directory

.
├──index.js
├──package.json
└──/src/
     ├──image.png
     ├──index.html
     └──/directory-a/
          └──file.html

index.js

const localhost = require('local-routes');

localhost.run({dirname: __dirname + "/src"/*, host: "127.0.0.1", port: 8080*/});

In this case, the files will be available in the browser at:

  • http://localhost:3000/image.png
  • http://localhost:3000/index.html
  • http://localhost:3000/directory-a/file.html

Links

Help

If you are experiencing problems, or you just need a nudge in the right direction, please do not hesitate to create a New Issue on Github repository.

Package Sidebar

Install

npm i local-routes

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

8.4 kB

Total Files

8

Last publish

Collaborators

  • kirigod