React.js: Example in tutorial not working

后端 未结 7 1090
陌清茗
陌清茗 2020-12-29 01:45

I\'m doing the React.js tutorial from http://facebook.github.io/react/docs/tutorial.html. Here are my files:

template.html:


    

        
7条回答
  •  一个人的身影
    2020-12-29 02:21

    Expanding on #2 from Paul O'Shannessy's answer.

    The nice solution is :

    If you have python2.x:

    $ cd /myreact-project/htmlfiles/
    $ python -m SimpleHTTPServer
    

    For python3.x

    $ cd /myreact-project/htmlfiles/
    $ python -m http.server
    

    You can then point your browser to http://192.168.1.2:8000/ or where ever the python module is serving your files and use it from any browser without hassles.

提交回复
热议问题