如何 运行 codesandbox 中的应用程序具有不同的后端和前端子文件夹

How to run an application in codesandbox with different subfolder for backend and frontend

我想为我正在开发的应用程序获取一个 codesandbox。如何使项目与名为后端和前端的两个不同子文件夹一起工作? 那怎么办? 我正在为您发送我的 packages.json 文件内容:

{
  "name": "projeto_aplicado",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "dependencies": {
    "concurrently": "^6.2.0"
  },
  "devDependencies": {},
  "scripts": {
    "server": "npm run server --prefix backend",
    "start": "concurrently \"npm run server\" \"npm run client\" ",
    "client": "npm start --prefix frontend"
  },
  "author": "",
  "license": "ISC"
}

我也在为我的网络应用程序发送 link:https://codesandbox.io/s/blissful-fire-jjnl5?file=/package.json:0-393

据我所知,如果没有 Express,您不能在 codesandbox 上执行此操作,这是一个相关的 Github 问题:https://github.com/codesandbox/codesandbox-client/issues/1519.

This is for now not really possible unless you just display an HTML page from express :(

我搭了快车example starter template and edited it to work with 2 separate folders like your requirement, here's the link: https://codesandbox.io/s/cool-worker-wj464?file=/backend/app.js

我刚刚创建并重命名了一个文件夹,并更改了代码以使用正确的目录。