How to run html file using node js

前端 未结 8 864
南笙
南笙 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:25

    The simplest command by far:

    npx http-server

    This requires an existing index.html at the dir at where this command is being executed.

    This was already mentioned by Vijaya Simha, but I thought using npx is way cleaner and shorter. I am running a webserver with this approach since months.

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

提交回复
热议问题