Running a local copy of JS Bin
JS Bin v3 comes in two flavours: Node and PHP. Though PHP development has now ceased, everything in JS Bin 3.0 (with the exception of code casting and remote rendering) is available.
Installation requires a number of simple steps:
- Installing code
For the simplest install process we recommend using Node with SQLite. However, if you already have a PHP based environment and want to run JS Bin out of a subdirectory, this is also relatively straight forward to achieve.
You can (and should) install Node directly from
npm using the following command:
$ npm install -g jsbin
This will automatically install all the dependancies.
Download the source code for JS Bin either by cloning this project or downloading a zip file and decompressing in to a directory (such as
JS Bin comes with a default config file. You can either edit this directly, or we recommend copying and modifying your own copy that should be named
cp config.default.json config.local.json
There are a number of options that you can change to configure JS Bin to your needs. The property names, meaning and possible values have been listed below:
- url: Object - detailed next
This is an object controlling how URLs are generated in JS Bin. If you plan to run JS Bin from a subdirectory, you must change these settings.
- url.host: The host you will access JS Bin on, eg.
jsbin.devis what we use offline. If you want to include a port number here you should do, eg.
jsbin.dev:8000will request JS Bin over port 8000.
/or your subdirectory that JS Bin should be accessed from. For instance, if you run JS Bin under
url.prefixvalue must be
truewhether you want to run JS Bin over SSL.
falseor a url, such as
http://static.jsbin.dev:8000/jsbin/. This will control where static assets are served from. If the value is
false, they will be served from the same path as dyanmic content.