静的サーバーをローカルでたてるならhttp-serverを使うのがとても簡単。
やること
http-serverのインストール
- $ npm init -y
- $ npm install http-server
ファイルの作成
sample.txt
hello sampletest.txt
hello test実行
package.jsonにscriptを追加
"scripts":{
    "http-server": "http-server"
  }- $ npm run http-server
- http://localhost:8080 にアクセスする
 
  
  
  
  


Comments