@jsenv/exploring-server
v3.11.0
Published
[![npm package](https://img.shields.io/npm/v/@jsenv/exploring-server.svg)](https://www.npmjs.com/package/@jsenv/exploring-server) [![build](https://travis-ci.com/jsenv/jsenv-exploring-server.svg?branch=master)](http://travis-ci.com/jsenv/jsenv-exploring-s
Downloads
176
Readme
jsenv exploring server
Introduction
@jsenv/exploring-server
starts a server creating an html page listing your project files.
Each link goes to an url where your JavaScript file will be executed.
Thanks to this, any file or your project can become an entry point. You can use it to debug a file in isolation or even to create a storybook.
It has the following exports:
startExploringServer
How to use
To understand how to use jsenv exploring server let's use it on a "real" project. We will setup a basic project and start an exploring server inside it.
Steps to start exploring server on a basic project
Create basic project file structure
— see ./docs/basic-project
Install dependencies
npm install
Start the exploring server
node ./start-exploring-server.js
Using the exploring server
A first main server will start. This one is used by the whole jsenv project.
A second server will start. That's the one we're interested in right now. The url http://127.0.0.1:3456
is logged in your terminal.
Once server is started you can navigate to http://127.0.0.1:3456
and you will see an html page listing the files you can explore.
- If you go to
http://127.0.0.1:3456/src/hello.js
page displaysHello world
. It shows that if your file execution renders something, you can see the effect in your browser. - If you go to
http://127.0.0.1:3456/src/text.js
nothing special will happen because/src/text.js
is just a module with an export default. It shows that even if your file do not render anything, you still can use this functionnality to debug your file.
Here is a gif showing me browing basic project files:
If you want to know more about startExploringServer
, there is a dedicated page for that.
— see startExploringServer
documentation
Installation
npm install --save-dev @jsenv/[email protected]
yarn add @jsenv/[email protected] --dev