Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I create web api using express.js and not have node.js installed?

I am currently in the process of creating a portfolio website for myself but due to hosting restrictions, I cannot make use of Node.js.

I know Angular can run on any web server, but is it possible to make use of Express.js to create web api's with relying on Node.js to run these web api's using Express.js?

If not, is there an alternative solution to create web api's that I can call using Angular and later for my mobile version of my website?

Please note that my shared hosting runs using cPanel.

like image 797
Edward Whitehead Avatar asked Aug 17 '26 14:08

Edward Whitehead


2 Answers

As per definition Express.js, or simply Express, is a web application framework for Node.js so you can't do that. Alternatives would be to use a different backend language. That also depends if your server supports them, for example, you can go with .NET CORE

like image 84
jitender Avatar answered Aug 20 '26 05:08

jitender


You cannot use Express without NodeJS by definition so you have to deploy your backend somewhere else in you want to use it.

I suggest giving a look Firebase: you could write your backend using http cloud functions in express without paying anything until a reasonable amount of traffic (after that, is pretty cheap). You could also get rid of cPanel and deploy your frontend there via Firebase hosting.

like image 29
michelepatrassi Avatar answered Aug 20 '26 05:08

michelepatrassi