-2

I'm trying to build a simple web app (I'm newbie in Node.js, Yeoman, Grunt) and I'm following this great tutorial - "Build a M.E.A.N web app".

The only thing that I don't understand is why when running

grunt serve

I got urls like localhost:9000/#/projects. What's the point of the '#'?

Any help would be greatly appreciated.

Here you could find my gruntfile.

1 Answers1

3

It's not because of grunt serve, hashtag adds angular. It is how browser works with single page application(SPA). When you don't reload your page, client javascript needs to know how to route requests and display views. If you want to turn off this feature, you need to switch it in angular with:

$locationProvider
  .html5Mode(true)

More on question you can read here

Community
  • 1
  • 1
vanadium23
  • 3,516
  • 15
  • 27