Auth0 React JS模板-仅在没有API服务器的情况下运行应用程序

问题描述

我正在使用此处提供的Auth0快速入门应用程序。它运行没有问题

https://auth0.com/docs/quickstart/spa/react

现在,在学习完本教程之后,我将像使用任何react js应用程序一样执行“ npm start”。我在控制台中得到以下内容。

> [email protected] start D:\coderepos\RandomStuffGeneratorExperimental\Apps\ZeroPointTwoPointZero
> npm-run-all --parallel spa api-server "spa"


> [email protected] spa D:\coderepos\RandomStuffGeneratorExperimental\Apps\ZeroPointTwoPointZero
> react-scripts start


> [email protected] api-server D:\coderepos\RandomStuffGeneratorExperimental\Apps\ZeroPointTwoPointZero
> node api-server.js


> [email protected] spa D:\coderepos\RandomStuffGeneratorExperimental\Apps\ZeroPointTwoPointZero
> react-scripts start

API Server listening on port 3001

然后,该应用程序在localhost上运行。我是.NET后端开发人员,所以,我有自己的API服务器。我正在尝试学习React JS,所以那里有一些基本知识。但是,我意识到最近几天,该模板自动运行了我不需要的快速检查节点JS API服务器。

我了解,是因为这部分

"API Server listening on port 3001"

我看看package.json,我有以下内容。

  "scripts": {
    "start": "npm-run-all --parallel spa api-server","build": "react-scripts build","test": "react-scripts test --env=jest-environment-jsdom-sixteen","eject": "react-scripts eject","spa": "react-scripts start","server": "node server.js","server:dev": "nodemon server.js","api-server": "node api-server.js","api-server:dev": "nodemon api-server.js","dev": "npm-run-all --parallel spa api-server:dev","prod": "npm-run-all --parallel server api-server"
  },

我知道,这一行使应用程序和api服务器都运行。

"start": "npm-run-all --parallel spa api-server",

我对节点JS的了解非常有限。我知道,我可以从开始删除“ api-server”,这将停止api服务器的运行。我还看到有一个叫做“ spa”的东西,它肯定是该应用程序。我已经尝试了以下方法,但这不起作用。

npm spa

我很抱歉这是一个天真的,重复的还是基本的问题,但是,如何使用此特定的package.json配置直接运行react app'spa'?

注意:我不想编辑“开始”部分。我想保持原样。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)