Skip to content

Commit c46c925

Browse files
authored
Merge pull request #52 from sakamotopaya/eo/as-an-api
as an api, first pass
2 parents 53ed4fa + 019ef57 commit c46c925

22 files changed

+11606
-4
lines changed

.vscode/launch.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,61 @@
2424
"group": "tasks",
2525
"order": 1
2626
}
27+
},
28+
{
29+
"name": "Run API Server",
30+
"type": "node",
31+
"request": "launch",
32+
"program": "${workspaceFolder}/src/api/api-entry.ts",
33+
"outFiles": ["${workspaceFolder}/src/dist/**/*.js"],
34+
"sourceMaps": true,
35+
"runtimeArgs": ["-r", "ts-node/register"],
36+
"envFile": "${workspaceFolder}/.env",
37+
"env": {
38+
"NODE_ENV": "development",
39+
"API_PORT": "3000",
40+
"API_HOST": "localhost",
41+
"API_WORKSPACE_ROOT": "${workspaceFolder}",
42+
"API_VERBOSE": "true",
43+
"API_DEBUG": "true"
44+
},
45+
"console": "integratedTerminal",
46+
"internalConsoleOptions": "neverOpen",
47+
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
48+
"presentation": {
49+
"hidden": false,
50+
"group": "tasks",
51+
"order": 2
52+
},
53+
"preLaunchTask": "build",
54+
"restart": true,
55+
"autoAttachChildProcesses": true
56+
},
57+
{
58+
"name": "Run API Server (Production)",
59+
"type": "node",
60+
"request": "launch",
61+
"program": "${workspaceFolder}/src/dist/api/api-entry.js",
62+
"outFiles": ["${workspaceFolder}/src/dist/**/*.js"],
63+
"sourceMaps": true,
64+
"envFile": "${workspaceFolder}/.env",
65+
"env": {
66+
"NODE_ENV": "production",
67+
"API_PORT": "3000",
68+
"API_HOST": "localhost",
69+
"API_WORKSPACE_ROOT": "${workspaceFolder}",
70+
"API_VERBOSE": "false",
71+
"API_DEBUG": "false"
72+
},
73+
"console": "integratedTerminal",
74+
"internalConsoleOptions": "neverOpen",
75+
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
76+
"presentation": {
77+
"hidden": false,
78+
"group": "tasks",
79+
"order": 3
80+
},
81+
"preLaunchTask": "build"
2782
}
2883
]
2984
}

.vscode/tasks.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,62 @@
6969
"group": "watch",
7070
"reveal": "always"
7171
}
72+
},
73+
{
74+
"label": "build",
75+
"type": "shell",
76+
"command": "pnpm bundle",
77+
"group": {
78+
"kind": "build",
79+
"isDefault": false
80+
},
81+
"problemMatcher": "$tsc",
82+
"presentation": {
83+
"echo": true,
84+
"reveal": "always",
85+
"focus": false,
86+
"panel": "shared",
87+
"showReuseMessage": true,
88+
"clear": false
89+
},
90+
"options": {
91+
"cwd": "${workspaceFolder}/src"
92+
}
93+
},
94+
{
95+
"label": "build:api",
96+
"type": "shell",
97+
"command": "pnpm bundle",
98+
"group": "build",
99+
"problemMatcher": "$tsc",
100+
"presentation": {
101+
"echo": true,
102+
"reveal": "always",
103+
"focus": false,
104+
"panel": "shared",
105+
"showReuseMessage": true,
106+
"clear": false
107+
},
108+
"options": {
109+
"cwd": "${workspaceFolder}/src"
110+
}
111+
},
112+
{
113+
"label": "install:api-deps",
114+
"type": "shell",
115+
"command": "npm install fastify @fastify/cors @fastify/helmet",
116+
"group": "build",
117+
"presentation": {
118+
"echo": true,
119+
"reveal": "always",
120+
"focus": false,
121+
"panel": "shared",
122+
"showReuseMessage": true,
123+
"clear": false
124+
},
125+
"options": {
126+
"cwd": "${workspaceFolder}/src"
127+
}
72128
}
73129
]
74130
}

0 commit comments

Comments
 (0)