Nodejs API authors or web devs how do you setup your api and it’s website?

  Kiến thức lập trình

I’ve been having trouble with setting up an environment so that my nodejs project with web pages (all the guides say use ejs or place web pages in /public directory) work together nicely. All of those recommendations or instructions work ok at the start but have limitations later on.

Nodejs API authors how do you setup your API and website projects?

Do you have ONE vscode project for both web pages and nodejs?
Or do you keep them separate?

Please, if you can, share your ts-config files. This is where my problems come from. Two separate tsconfigs (one for node and one for typescript in a sub directory).

BTW jerks, This isn’t opinion based question. I’m looking for a technical answer to a technical problem. This is the same as how do you define your tsconfig to do XYZ. My question is the same. How do you define your web and nodejs project.

Current problematic setup (one project):

/api-files-here.ts
/public/html-javascript-css-pages-here
/public/libraries-copied-from-node-module-source-here/library1.js
/public/libraries-copied-from-node-module-source-here/library2.js
/node_modules/
/ts-config-for-node-js.json
/public/ts-config-for-clientside-typescript.json

Setup:
Typescript
HTML
CSS
NodeJS
vscode
npm

LEAVE A COMMENT