Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Superstatic & HTML5 Urls #213

Open
jbeckton opened this issue Apr 11, 2016 · 2 comments
Open

Superstatic & HTML5 Urls #213

jbeckton opened this issue Apr 11, 2016 · 2 comments

Comments

@jbeckton
Copy link

Building an Angular 2 SPA. I have read about issues with Angular routes / HTML 5 urls but every thing I have tried to fix this does not work, I guess I am missing something. Not sure if its BS or Superstatic.

http://localhost:3000/home

/home is a route within my application, there is no home directory in my application structure. I get error "Cannot GET /home"

gulpfile.js

gulp.task('serve', function() {

 return browserSync.init({
    port: 3000,
    files: ['www/**/*.{html,htm,css,js}'], 
    injectChanges: true,
    logFileChanges: true,
    logLevel: 'info',    
    notify: true,
    open: "ui", 
    reloadDelay: 2000, // give typescript compilation time to complete
    reloadDebounce: 2000,
    ghostMode: false,
    server: {
        baseDir: ['www'],
        middleware: superstatic({ debug: true, config: "superstatic.json" })
    }
});
})

superstatic.json

{ "rewrites": [ {"source":"/**","destination":"/index.html"} ] }

@jbeckton
Copy link
Author

It does not seem like Superstatic is loading my .json config file

@mattbajorek
Copy link

If you are using the command line with a directory specified, make sure the .json file is in the current working directory rather than the specified directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants