deco-server is decofun as a service (DFaaS).
This can be very useful when debugging, particularly if a stack trace has been lost due to a next tick, and all you have to look at is piles of anonymous functions.
deco-server is currently running at http://decofun.herokuapp.com/, the below examples use this address for instant demo satisfation, but you can also install deco-server and run locally.
Say we have the following script tag
We simply prefix the src with a deco server, like so
Locally hosted scripts can be uploaded to
deco-server where they
are transformed and cached for 8 hours.
We can upload a script with curl like so
curl -F email@example.com http://decofun.herokuapp.com
When the upload is complete, the POST response will be a ':id/:filename', something like the following:
Once we have this we can alter our script tag, say we have a script tag like this
We simply change it to
To run deco-server locally
sudo npm i -g deco-server deco-server
This will start a server on port 8080. To specifiy the port do