How do I call a nodejs project from a web project?

I have discovered that the secret feature is not available for web (static) projects, so I am writing backend code for a website in a separate project. How do I make a request to my node project from my web project? I THINK I need to use the DB, but I wanted to ask so I don’t reinvent the wheel. I checked the documentation and I could not find it.

I am currently reading through and using this documentation: SQLite on Replit.

1 Like

If you mean you have two separate Repls, first of all I would recommend using the NodeJS Repl to host the site. Then, I would recommend using fetch to communicate with the NodeJS server.

For example:

fetch("<repl_url>/api", {
	method: "POST",
	body: JSON.stringify(/* some data */)

With some more information, I or someone else might be able to help you more. :slight_smile:

1 Like