How to create a localhost server to run an AngularJS project

前端 未结 13 665
迷失自我
迷失自我 2020-11-29 15:56

i have used Xampp and JetBrain WebStorm to run an AngularJS project. But it\'s complicated and low performance.Is there any other way to run an AngularJS project?

相关标签:
13条回答
  • 2020-11-29 16:24

    If you are a java guy simple place your angular folder in web content folder of your web application and deploy to your tomcat server. Super easy !

    0 讨论(0)
  • 2020-11-29 16:28

    Python has a built-in command specifically for spinning up a webserver:

    Python3.x:

    python -m http.server 8000
    

    Other versions:

    python -m SimpleHTTPServer 8000
    

    Would start a webserver on port 8000

    (Python is a prerequisite to this; if you don't have python installed, the other answers may be easier)

    0 讨论(0)
  • 2020-11-29 16:29

    If you have used Visual Studio Community or any other edition for your angular project , then go to the project folder , first type

    C:\Project Folder>npm install -g http-server You will see as follows: + http-server@0.11.1 added 25 packages in 4.213s

    Then type C:\Project Folder>http-server –o

    You will see that your application automatically comes up at http://127.0.0.1:8080/

    0 讨论(0)
  • 2020-11-29 16:30

    cd <your project folder> (where your angularjs's deployable code is there)

    sudo npm install serve -g

    serve

    You can hit your page at

    localhost:3000 or IPaddress:3000

    0 讨论(0)
  • 2020-11-29 16:33
    • Run
    ng serve

    This command run in your terminal after your in project folder location like ~/my-app$

    • Then run the command - it will show the URl NG Live Development Server is listening on localhost:4200

    • Open your browser on http://localhost:4200

    0 讨论(0)
  • 2020-11-29 16:34

    You can begin by installing Node.js from terminal or cmd:

    apt-get install nodejs-legacy npm
    

    Then install the dependencies:

    npm install
    

    Then, start the server:

    npm start
    
    0 讨论(0)
提交回复
热议问题