Skip to content

Commit

Permalink
Deprecate contentBase with a URL or port
Browse files Browse the repository at this point in the history
This was originally introduced before the `proxy` option was a thing.
Now we have the `proxy` option, it is better to use that instead
since it is way more powerful and can do the same.
  • Loading branch information
SpaceK33z committed Oct 19, 2016
1 parent f779ef8 commit 61b46ba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ function Server(compiler, options) {
app.get("*", express.static(item));
});
} else if(/^(https?:)?\/\//.test(contentBase)) {
console.log("Using a URL as contentBase is deprecated and will be removed in the next major version. Please use the proxy option instead.");
console.log('proxy: {\n\t"*": "<your current contentBase configuration>"\n}'); // eslint-disable-line quotes
// Redirect every request to contentBase
app.get("*", function(req, res) {
res.writeHead(302, {
Expand All @@ -247,6 +249,8 @@ function Server(compiler, options) {
res.end();
});
} else if(typeof contentBase === "number") {
console.log("Using a number as contentBase is deprecated and will be removed in the next major version. Please use the proxy option instead.");
console.log('proxy: {\n\t"*": "//localhost:<your current contentBase configuration>"\n}'); // eslint-disable-line quotes
// Redirect every request to the port contentBase
app.get("*", function(req, res) {
res.writeHead(302, {
Expand Down

0 comments on commit 61b46ba

Please sign in to comment.