node http-server doesn't find a folder.



  • Using http-server of npm, the file structure is:

    • http-server
    • node_modules
    • public

      • index.html; js; cs

    src="/node_modules/angular/angular.js" I'm.

    Doesn't find him what to do?



  • From https://www.npmjs.com/package/http-server#usage :

    Use:

    http-server [path] [options]
    

    [path] Default ./publicif this folder exists, otherwise ./

    Server gives the file. publicit is the root of the site. A node_modules She's not.

    What to do plenty of options.

    It's a good way to collect one healthy JSin with all the addictions somewhere. public With some kind of bandler, a lot of them. Name https://webpack.github.io/ and http://browserify.org/ ♪

    AngularJS can be installed differently through Bower, https://stackoverflow.com/a/14080568/2076787 :

    {
      "directory" : "public/components"
    }
    

    You can also configure the web server to give files on different addresses from different files. But it's already if you are. Not to be used http-serverOh.


    Rapid and dirty move is to make a simlin. https://ru.wikipedia.org/wiki/%D0%A1%D0%B8%D0%BC%D0%B2%D0%BE%D0%BB%D1%8C%D0%BD%D0%B0%D1%8F_%D1%81%D1%81%D1%8B%D0%BB%D0%BA%D0%B0 ) public to the location of the hangar. I won't be able to bring the team up because it's a dangerous welcome to use only if you know exactly what you're doing.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2