Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

html5Mode support. #195

Closed
wants to merge 11 commits into from
Closed

html5Mode support. #195

wants to merge 11 commits into from

Conversation

rhutchison
Copy link
Contributor

Open for discussion. This pull request enables use of html5Mode. This should also still work with html5Mode(false).

@uwolfer
Copy link
Contributor

uwolfer commented Oct 12, 2014

I'm using this patch set and it seems to work without issues. Thanks for sharing.

@rhutchison
Copy link
Contributor Author

This has been updated to leverage public/config.js. I changed the default to false, as I am told this is the more common implementation. I will be adding it to generator with a param as part of the application setup.

@sunshineo
Copy link

This is very helpful!
I vote for have the default set to true. There are a lot of benefit with copy paste link and SEO using html5Mode true.
I even vote for not give the configuration option and default to html5Mode true. Convention over configuration. MEAN.JS is all about pick the convention for the user. If user want the flexibility, use just Node+Express and they can plug and play.


With some more readings, I feel I may be wrong about what I said above.

@tylerdmace
Copy link

I vote we leave 'false' as default. I don't believe SEO nor pretty URLs are going to be of importance to most applications.

@ilanbiala
Copy link
Member

@tylerdmace most care about pretty URLs and SEO, because that's how you grow. Besides it doesn't add much trouble, just that you add 1 route that sends the index.html template instead of a 404, and you pass back the original url and let Angular do all the routing other than API.

@tylerdmace
Copy link

There's no way to easily gauge the implementation type of most MEAN applications so I digress. However, I have changed my mind on the issue since you're right in that having the support doesn't really have any drawbacks. The downsides for not having it are poor SEO support and ugly URLs but the downside for having it are... well, nothing, really - but we need to have a way to fall back to hashbang URLs for people who need the older tech for support reasons.

@ilanbiala
Copy link
Member

that's what Angular does anyway. You just do $locationProvider.html5Mode(true).hashPrefix('!'); like @rhutchison did in the PR.

Conflicts:
	app/routes/articles.server.routes.js
	app/routes/core.server.routes.js
	config/express.js
Conflicts:
	app/tests/article.server.routes.test.js
	config/express.js
@amoshaviv
Copy link
Contributor

added in the new version

@amoshaviv amoshaviv closed this Nov 26, 2014
@ebraminio
Copy link

Where it is merged? I can not see it neither on 0.4 branch nor master.

@xxorax
Copy link

xxorax commented Dec 27, 2014

I confirm, the routes were not merged.

@woniesong92
Copy link

Is it merged?

@simison
Copy link
Member

simison commented Jan 4, 2015

@monad98
Copy link

monad98 commented Feb 5, 2015

@rhutchison
I still have problem. When I refresh the page at "/articles", I am automatically signed out.
The other pages like "/articles/create", "/settings/profile" is ok.

EDIT: This problem also happens without html5mode. :(

@rhutchison
Copy link
Contributor Author

@monad98 this PR is pretty out dated from upstream, so not sure how reliable it would be. I know @amoshaviv manually plucked these changes and put them in to the 0.4.0 branch (ab81d61#diff-90593c1684669b4a0cc185ec424f0a24R9) - have you had any luck there?

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

Successfully merging this pull request may close these issues.