From e5c04b5fd16021aa98d8857185cd206106ed88dd Mon Sep 17 00:00:00 2001 From: David Jay Date: Mon, 7 Nov 2016 13:51:40 -0500 Subject: [PATCH] Updating routes and adding dev webpack to package.json --- client/coral-embed-stream/webpack.config.dev.js | 5 +++-- client/coral-framework/store/actions/items.js | 5 +++-- package.json | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client/coral-embed-stream/webpack.config.dev.js b/client/coral-embed-stream/webpack.config.dev.js index 977300ecd..250276915 100644 --- a/client/coral-embed-stream/webpack.config.dev.js +++ b/client/coral-embed-stream/webpack.config.dev.js @@ -9,13 +9,14 @@ module.exports = { path.join(__dirname, 'src', 'app') ], output: { - path: path.join(__dirname, 'dist'), + path: path.join(__dirname, '..', '..','dist', 'coral-embed-stream'), filename: 'bundle.js', publicPath: '/' }, resolve: { root: [ - path.resolve(__dirname, 'src') + path.resolve(__dirname, 'src'), + path.resolve(__dirname, '..') ], extensions: ['', '.js', '.jsx'] }, diff --git a/client/coral-framework/store/actions/items.js b/client/coral-framework/store/actions/items.js index 019b1bfbe..8aea884ad 100644 --- a/client/coral-framework/store/actions/items.js +++ b/client/coral-framework/store/actions/items.js @@ -180,7 +180,8 @@ export function postItem (item, type, id) { method: 'POST', body: JSON.stringify(item) } - return fetch('api/v1/' + type, options) + console.log('postItem', options); + return fetch('/api/v1/' + type, options) .then( response => { return response.ok ? response.json() @@ -223,7 +224,7 @@ export function postAction (id, type, user_id) { } dispatch(appendItemArray(id, type, user_id)) - return fetch('api/v1/comments/' + id + '/actions', options) + return fetch('/api/v1/comments/' + id + '/actions', options) .then( response => { return response.ok ? response.text() diff --git a/package.json b/package.json index 17a6bda02..8777bc457 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "pretest": "npm install", "test": "mocha tests --recursive", "test-watch": "mocha tests --recursive -w", - "embed-start": "node client/coral-embed-stream/dev-server.js" + "embed-start": "webpack --config ./client/coral-embed-stream/webpack.config.dev.js && ./bin/www" }, "config": { "pre-git": {