【问题标题】:How to load a specific page with npm start如何使用 npm start 加载特定页面
【发布时间】:2020-01-14 12:44:27
【问题描述】:

当我运行 npm-start 时,它会加载,但它只会加载 http://127.0.0.1:8000。

我想在运行 npm start 时加载类似 http://127.0.0.1:8000/launch 的内容

下面是我的package.json:

{
  "name": "myapp",
  "version": "0.1.3",
  "scripts": {
    "serve": "http-server -p 8000 -c-1 .",
    "start": "npm run serve",
  }
  ...
}

目前正在加载http://127.0.0.1:8000

这是我想看到的; http://127.0.0.1:8000/launch

【问题讨论】:

    标签: npm node-modules npm-install package.json npm-start


    【解决方案1】:

    Solution: npm 同时安装 -g
    然后在 package.jason 文件中更新服务

    "serve": "concurrently \"http-server -p 8000 -c-1.\" \"start http://127.0.0.1:8000/launch\""
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-09-26
      • 2010-12-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-08
      • 2017-01-29
      • 2012-03-21
      相关资源
      最近更新 更多