Skip to content

ryanfowlkes/ExpressiveJS

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

expressive

Expressive.js

Expressive is a developer tool that tracks and visualizes server routes in Express applications. Useful for debugging and teaching alike, Expressive enables developers to send client requests to their Express server, and then render a dynamic and comprehensive visualization of server state throughout the lifespan of each request -- all from the command line.

Install

$ npm install expressivejs --save-dev

Setup

1) Modify Express server files

Replace all instances of require('express') with require('expressivejs'). This will enable Expressive to progressively document the state of client requests and server responses.

2) Create a configuration file

This file should be called expressive.config.js and be located in your application's root directory.

Option 1: Use the command line

TBD

Option 2: Create expressive.config.js manually

TBD

Testing Server Routes

Command Line Scripts

$ xpr-test: Test your server routes. Sends http requests to your Express server as specified in your expressive.config.js file. This will create an expressive.json file in which information on request and response states is stored. If the file already exists from previous tests, it will be overwritten.

$ xpr-build: Bundle data from the expressive.json file created using the xpr-test command for use in rendering a visualization of your server routes.

$ xpr-display: Render a visualization of your server routes based on the data bundled from the xpr-test command.

$ xpr: Test your server routes, then bundle the collected data, and then render a visualization. Equivalent to running xpr-test followed by xpr-build followed by xpr-display.

Important

Do not alter res.locals._XPR

Any server middleware that alters res.locals._XPR will interfere with Expressive's functionality. Expressive tracks the state of client requests and server responses by storing information at the _XPR key within the locals property of the server response body.

On relocating expressive.config.js

When relocating your Expressive configuration file, be sure to alter its relative path to your server file accordingly.

Expressive is not for use in production

Before running your application for non-testing purposes, be sure to change all instances of require('expressivejs') in your server files back to require('express').

Expressive is in active development.

Follow our GitHub repo for updates.

Contributors

Glenn Alexander | Ryan Fowlkes Smith | Kangseon Cho | Mary Snow

About

End to end server tracking for optimal debugging

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 86.8%
  • CSS 11.1%
  • HTML 2.1%