Skip to content

Commit

Permalink
Warn about /js/app.js being deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
koute committed Dec 12, 2018
1 parent da03fa4 commit 647e29e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cmd_start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ pub fn command_start< 'a >( matches: &clap::ArgMatches< 'a > ) -> Result< (), Er

let _watcher = monitor_for_changes_and_rebuild( last_build.clone() );

let target_name = target.name.clone();
let address = address_or_default( matches );
let server = SimpleServer::new(&address, move |request| {
let path = request.uri().path();
Expand All @@ -290,6 +291,12 @@ pub fn command_start< 'a >( matches: &clap::ArgMatches< 'a > ) -> Result< (), Er
return response_from_data("application/text", data.into_bytes());
}

if path == "/js/app.js" {
eprintln!( "!!!!!!!!!!!!!!!!!!!!!" );
eprintln!( "WARNING: `/js/app.js` is deprecated; you should update your HTML file to use `/{}.js` instead!", target_name );
eprintln!( "!!!!!!!!!!!!!!!!!!!!!" );
}

debug!( "Received a request for {:?}", path );
if let Some( mut artifact ) = last_build.deployment.get_by_url(&path) {
if auto_reload && (path == "/" || path == "/index.html") {
Expand Down

0 comments on commit 647e29e

Please sign in to comment.