Added an example proxy route to webpack.config.js
This commit is contained in:
@@ -28,7 +28,7 @@ const NewsPublisher = props => {
|
|||||||
<input type='text' name='title' placeholder='Title' ref={titleRef} />
|
<input type='text' name='title' placeholder='Title' ref={titleRef} />
|
||||||
<input type='text' name='author' placeholder='Author' ref={authorRef} />
|
<input type='text' name='author' placeholder='Author' ref={authorRef} />
|
||||||
<textarea name='body' rows='10' cols='150' placeholder='Body of the article goes here...' ref={bodyRef} />
|
<textarea name='body' rows='10' cols='150' placeholder='Body of the article goes here...' ref={bodyRef} />
|
||||||
|
|
||||||
<button type='submit'>Publish</button>
|
<button type='submit'>Publish</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -93,6 +93,12 @@ module.exports = ({ production, analyze }) => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
proxy: {
|
||||||
|
'/api': {
|
||||||
|
target: 'http://localhost:3000'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
static: '/public'
|
static: '/public'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user