Commit 13edea6e022b411d480bb5ce4afc4c2f2beaa082
1 parent
92ea696c
chore: support debug strapi app in vscode
Showing
3 changed files
with
26 additions
and
0 deletions
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 | \ No newline at end of file | 15 | \ No newline at end of file |
back-end/h5-api/package.json
| @@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
| 4 | "version": "0.1.0", | 4 | "version": "0.1.0", |
| 5 | "description": "A Strapi application", | 5 | "description": "A Strapi application", |
| 6 | "scripts": { | 6 | "scripts": { |
| 7 | + "localdev": "node server.js", | ||
| 7 | "dev": "strapi develop", | 8 | "dev": "strapi develop", |
| 8 | "start": "strapi start", | 9 | "start": "strapi start", |
| 9 | "build": "strapi build", | 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 | \ No newline at end of file | 12 | \ No newline at end of file |