How do you set up your API and its 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).

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