How to run html file using node js

前端 未结 8 862
南笙
南笙 2021-01-30 11:04

I have a simple html page with angular js as follows:

    //Application name
    var app = angular.module(\"myTmoApppdl\", []);

    app.controller(\"myCtrl\", f         


        
8条回答
  •  隐瞒了意图╮
    2021-01-30 11:27

    http access and get the html files served on 8080:

    >npm install -g http-server
    
    >http-server
    

    if you have public (./public/index.html) folder it will be the root of your server if not will be the one that you run the server. you could send the folder as paramenter ex:

    http-server [path] [options]
    

    expected Result:

    *> Starting up http-server, serving ./public Available on:

    http://LOCALIP:8080

    http://127.0.0.1:8080

    Hit CTRL-C to stop the server

    http-server stopped.*

    Now, you can run: http://localhost:8080

    will open the index.html on the ./public folder

    references: https://www.npmjs.com/package/http-server

提交回复
热议问题