Commit 13edea6e022b411d480bb5ce4afc4c2f2beaa082

Authored by ly525
1 parent 92ea696c

chore: support debug strapi app in vscode

back-end/h5-api/.vscode/launch.json 0 → 100644
  1 +{
  2 + // Use IntelliSense to learn about possible attributes.
  3 + // Hover to view descriptions of existing attributes.
  4 + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  5 + "version": "0.2.0",
  6 + "configurations": [
  7 + {
  8 + "type": "node",
  9 + "request": "launch",
  10 + "name": "Launch Program",
  11 + "program": "${workspaceFolder}/server.js"
  12 + },
  13 + ]
  14 +}
0 15 \ No newline at end of file
... ...
back-end/h5-api/package.json
... ... @@ -4,6 +4,7 @@
4 4 "version": "0.1.0",
5 5 "description": "A Strapi application",
6 6 "scripts": {
  7 + "localdev": "node server.js",
7 8 "dev": "strapi develop",
8 9 "start": "strapi start",
9 10 "build": "strapi build",
... ...
back-end/h5-api/server.js 0 → 100644
  1 +#!/usr/bin/env node
  2 +'use strict';
  3 +
  4 +/**
  5 + * #!zh: 为了支持在 vscode 中进行 debug,添加 server.js。更多请参见: https://github.com/ly525/blog/issues/310
  6 + * #!en: add server.js for debug in vscode, see more here: https://github.com/ly525/blog/issues/310
  7 + */
  8 +
  9 +// Start Strapi
  10 +const strapi = require('strapi');
  11 +strapi().start();
0 12 \ No newline at end of file
... ...