Wie kriege ich diese Restful api auf meinen apache webserver?

Hallo!

Ich habe eine Restful api mit node.js programmiert ich habe folgendes benutzt:
Express und sqlite3.

Nun möchte ich wissen wie genau ich diese API auf meinem apache webserver zum laufen bringen kann. Ich bin schon googeln gegangen und ich habe nur heraus gefunden, dass ich nodejs express und sqlite3 irgendwie auf meinem webserver zum laufen bringen muss wie das geht habe ich keine Ahnung, deswegen bin ich hier gelandet und hoffe sehr das mir jemand behilflich sein kann.

Schonmal danke im voraus

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
15 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
gewinnowitsch
1 year ago

A node.js application must also be started on a node-enabled web server.

Apache can only run PHP. (There are attempts to start node.js server via PHP, but this is not recommended.)

Heroku or Vercel offer (in dimensions) free node.js hosting.

If it’s just about your local computer and not about availability on the Internet, you can easily start a node server via the command line or via a corresponding command in the package.json.

gewinnowitsch
1 year ago
Reply to  Fischkopf289

As long as it doesn’t have to be accessible on the Internet, it’s enough to start the API locally on your PC.

Do not let the PC turn off 😁

gewinnowitsch
1 year ago

Nee, in your network, everyone can access the network-internal IP of your computer and the port that the app is looking for when starting itself.

Example: You start the server

node backend/server.js

then comes in the console

Server listening on port 3000

Then, within your network, everyone can access the API with the IP of your computer (e.g. 192.168.178.27, you have to look into the network properties on your computer).

Address would then be in the example 192.168.178.27:3000

FaTech
1 year ago

If it’s a pure WebSpace, then not at all if it’s not designed for it.

If it’s a server, you’ll need to make more information on what a server is.

FaTech
1 year ago
Reply to  Fischkopf289

In this case, you host this via node and not via apache. https://nodejs.org/en

FaTech
1 year ago

Website, app, program … Do you even know what an API / ReST API is?

FaTech
1 year ago

Release port in your local firewall. That’s all. Then the other one with the port on it. Since your Apache already listens to 80, you should choose another

FaTech
1 year ago

As already said, you host JavaScript with NodeJS and not with Apache. I can repeat myself every time or you accept it. You need a JavaScript that can host and then you start it with NodeJS. Since you say you already have a RestAPI and want to host it, I assume that it works as soon as you start it with Node