From 579b390b32d9ebf70436f8dcb11c18cc5b7ba586 Mon Sep 17 00:00:00 2001 From: Fernando Falci Date: Mon, 6 Mar 2017 08:49:22 -0300 Subject: [PATCH] Use docker for develop phase --- README.md | 10 +++++++--- gulp/server.js | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e69bbfd..283d922 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,15 @@ * Gulp - Install: `npm install gulp -g` ## Gulp tasks -* `gulp serve` - Will build and create a local server. This instance will call the Axiom Zen's API. +* `gulp serve` - Will build and create a local server. This instance will call the localhost API. * `gulp dist` - Will build the UI using minified javascript. The build will be in the `dist` folder. * `gulp test` - Will run all unit tests. * `gulp tdd` - Will run all unit tests, watch file changes and run again. -## Demo +## Development -There is a running instance here: https://pugstunt.github.io/mastermind/ +You can use Docker to run the backend and proxy it. +```sh +docker run -d --name=redis redis:alpine +docker run -d -p 8080:8080 --link redis:db -e redis.connection.string=redis://db:6379 pugstunt/mastermind-api:latest +``` diff --git a/gulp/server.js b/gulp/server.js index 500b0c0..985720d 100644 --- a/gulp/server.js +++ b/gulp/server.js @@ -33,7 +33,7 @@ function browserSyncInit(baseDir, browser) { * * For more details and option, https://github.com/chimurai/http-proxy-middleware/blob/v0.9.0/README.md */ - // server.middleware = proxyMiddleware('/users', {target: 'http://jsonplaceholder.typicode.com', changeOrigin: true}); + server.middleware = proxyMiddleware('/api', {target: 'http://localhost:8080/mastermind/api/v1', pathRewrite: {'^/api' : ''}}); browserSync.instance = browserSync.init({ startPath: '/',