Selaa lähdekoodia

Ship a small webserver for local testing. Fixes #12

Kevin van Zonneveld 9 vuotta sitten
vanhempi
commit
a2428babfd
2 muutettua tiedostoa jossa 23 lisäystä ja 2 poistoa
  1. 19 0
      README.md
  2. 4 2
      package.json

+ 19 - 0
README.md

@@ -13,3 +13,22 @@ A work in progress - nothing to see here.
  - Themable UI with a beautiful default. UI is opt-out if people want to use just tus for instance
 
 Check [open issues](https://github.com/transloadit/transloadit-js-client/milestones/Minimum%20Viable%20Product) for our Minimum Viable Product. 
+
+## Local Development
+
+First clone and install the project:
+
+```bash
+git clone git@github.com:transloadit/transloadit-js-client.git
+cd transloadit-js-client
+npm install
+```
+
+Now to get a sandbox environment set up, type:
+
+```bash
+npm run preview
+```
+
+This will `npm run build` the project into `./build`, and then serve that
+directory using a simple static http server.

+ 4 - 2
package.json

@@ -10,7 +10,8 @@
     "watch": "npm run watch:js & npm run watch:css",
     "watch:js": "watchify js/lib/transloadit-js-client.js -do build/transloadit-js-client.js",
     "watch:css": "nodemon -e scss -x \"npm run build:css\"",
-    "test": "echo \"Error: no test specified\" && exit 1"
+    "test": "echo \"Error: no test specified\" && exit 1",
+    "preview": "npm run build & http-server ./build -d -o "
   },
   "repository": {
     "type": "git",
@@ -27,6 +28,7 @@
     "browserify": "^12.0.1",
     "node-sass": "^3.4.2",
     "nodemon": "^1.8.1",
-    "watchify": "^3.6.1"
+    "watchify": "^3.6.1",
+    "http-server": "^0.8.5"
   }
 }