Git Product home page Git Product logo

Comments (33)

paulsonnentag avatar paulsonnentag commented on May 5, 2024 5

I used superstatic to solve the problem: https://www.npmjs.com/package/superstatic

from http-server.

eljefedelrodeodeljefe avatar eljefedelrodeodeljefe commented on May 5, 2024 4

Thanks for mentioning superstaic worked well for me.

from http-server.

therebelrobot avatar therebelrobot commented on May 5, 2024 2

hey @indexzero :) what's the status on that PR review? Need any help?

from http-server.

indexzero avatar indexzero commented on May 5, 2024 1

This looks good. Will try to review this soon. Pretty behind on my maintenance for this project; apologies. Holidays!

from http-server.

nelsonec87 avatar nelsonec87 commented on May 5, 2024 1

+1

from http-server.

atalis avatar atalis commented on May 5, 2024 1

+1

from http-server.

joshvillbrandt avatar joshvillbrandt commented on May 5, 2024 1

+1

from http-server.

konkissner avatar konkissner commented on May 5, 2024

+1

Angular JS html5 mode requires a redirect rule which forwards all requests to the index.html.
Would be good to know, if http-server offers any possiblity to create such a redirect rule.

from http-server.

HipsterZipster avatar HipsterZipster commented on May 5, 2024

+1

from http-server.

astoilkov avatar astoilkov commented on May 5, 2024

+1

from http-server.

johnmckay-reward avatar johnmckay-reward commented on May 5, 2024

If you are using ASP.Net MVC I wrote a couple of articles which cover it, I imagine other frameworks are similar in concept at least - http://www.codeproject.com/Articles/806500/Getting-started-with-AngularJS-and-ASP-NET-MVC-P

from http-server.

maxdumas avatar maxdumas commented on May 5, 2024

+1

from http-server.

d668 avatar d668 commented on May 5, 2024

@BumblebeeMan you tutorial is overkill, all you have to do is change RouteConfig.cs:

 routes.MapRoute(
    name: "Default",
    url: "{*anything}",
      defaults: new
      {
        controller = "Home",
        action = "Index",
      }
  );

and then return your index.html in Index method of Home controller.

But how to do it without ASP.NET MVC and where to host?

from http-server.

achorein avatar achorein commented on May 5, 2024

+1

from http-server.

luisrudge avatar luisrudge commented on May 5, 2024

still no solution to this?

from http-server.

d668 avatar d668 commented on May 5, 2024

what do you mean, it is resolved, use the snippet above

from http-server.

luisrudge avatar luisrudge commented on May 5, 2024

I'm not using aspnet mvc, so it's not resolved :)

from http-server.

d668 avatar d668 commented on May 5, 2024

i watched a course by PluralSight "Building AngularJS and Node.js Apps with the MEAN Stack" they do it with Node.js in few first lessons. Also have a look here http://stackoverflow.com/questions/17777967/using-angularjs-html5mode-with-nodejs-and-express

from http-server.

d668 avatar d668 commented on May 5, 2024

you don't have to call Node REST API then, you can just use Node to help Angular work in html5Mode=true

from http-server.

luisrudge avatar luisrudge commented on May 5, 2024

You're missing the point. I want to use this project, http-server, and be able to handle pushState urls.

from http-server.

katmai7 avatar katmai7 commented on May 5, 2024

+1

from http-server.

pensierinmusica avatar pensierinmusica commented on May 5, 2024

+1

(in the meantime if you use Gulp take a look at gulp-webserver)

from http-server.

derhuerst avatar derhuerst commented on May 5, 2024

I used superstatic to solve the problem: https://www.npmjs.com/package/superstatic

Why not use this?

from http-server.

herrherrmann avatar herrherrmann commented on May 5, 2024

+1

from http-server.

zwacky avatar zwacky commented on May 5, 2024

+1

if you tackle this, please try to make it usable without a config file, like superstatic curenlty does it.

from http-server.

indexzero avatar indexzero commented on May 5, 2024

A PR is welcome for this if it can be done in an efficient manner.

from http-server.

barroudjo avatar barroudjo commented on May 5, 2024

I think #194 would better resolve the issue than #205.
At least the option name is clearer, and it doesn't involve redirects.

from http-server.

dafunkphenomenon avatar dafunkphenomenon commented on May 5, 2024

any idea when this might be complete? I'm having to use something else to overcome this issue at the moment?

Thanls

from http-server.

AlJohri avatar AlJohri commented on May 5, 2024

I used this instead: https://github.com/scottcorgan/pushstate-server

from http-server.

derhuerst avatar derhuerst commented on May 5, 2024

@mmahalwy would you mind closing this issue? there's plenty of tooling available for this use case.

from http-server.

indexzero avatar indexzero commented on May 5, 2024

This is something the project wants to add. At this point it's clear the user base wants it, so I'm going to lock this issue to ensure it's not lost in the shuffle.

from http-server.

BigBlueHat avatar BigBlueHat commented on May 5, 2024

We're planning to add this "self-proxying" approach to the README to address this issue--see #338 (comment)

That should address this sort of usage without breaking the focus of this project on providing accurate HTTP responses.

from http-server.

thornjad avatar thornjad commented on May 5, 2024

The self-proxy hack will be added to the README in #513. Alternatives which explicitly support push-state include spa-http-server, superstatic and pushstate-server.

from http-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.