Node JS Deploying API to client without any Front End - mysql

If i created api in nodejs like login,registration,delete,add,update user like system and i want to give it to my client how can i deploy it??
Like we run our API's on POstman so how client will use it! I don't want to add any front End to it.

You have a few options... you can go for heroku or a virtual private server. For vps you have options like aws ec2, google cloud platform etc. You can host your app in a vps with a static ip. You can use pm2 to host the app. Https is better. Use an nginx reverse proxy for security. Proffesional api servers do the above...

Related

Connect to openshift app via lwip embedded hardware

I have uploaded a simple Rest API application in Openshift (starter program).
I have also an STM32 based hardware running Lwip (TCP/IP) protocol and my goal is to connect it to the above openshift app.
LWIP uses a function (tcp_connect) which uses the external ip of the app.
However I am struggling to understand and find the external IP of the openshift service running in a pod
Any suggestions?

json rest api, locally hosted, lan accessible

For some time now I try to figure it out how to create a json rest api and a database, host it locally and make it accessible in lan. I need this for an android app, exactly to parse data from database to app.
I created the json rest and database usimg XAMP but i didn't figure it out how to make them accessible from lan.
After that somebody recomanded me IIS and since then I did'n figure it out.
Some sugestions?
For the web api application, host in the IIS server in some other system. In the mobile application development environment is in same LAN network, then call the api using that web api system ipaddress instead of the localhost.

Express/NodeJS application on Cpanel

Ok so I have an app with a Node/Express API and everything works fine on localhost. I'm trying to figure out how to make everything work on CPanel that's running on Apache. The client side stuff but I am unable to fetch any data from the backed. I've searched and looked, yes, but I'm still quite unsure on how to approach this. Do I have to use a Virtual Host and if so what are the specific steps I need to do?
NodeJS doesn't run on Apache or Nginx. Most you can do in these web servers is to set a reverse proxy.
NodeJS has its own web-server. cPanel won't help you in that regard, since you only need to install NodeJS on your server (you must have SSH access-root), and run it from there. You can daemonize your Node process to keep running installing PM2 or Forever (NPM Packages).
Here's a good answer (search before asking, the issue might be solved by then).
Run node.js on cpanel hosting server
cPanel typically runs Apache or another web server that is shared among all the cPanel/unix accounts. The web server listens on port 80. Depending on the domain name in the requested URL, the web server uses "Virtual Hosting" to figure out which cPanel/unix account should process the request, i.e. in which home directory to find the files to serve and scripts to run. If the URL only contains an IP address, cPanel has to default to one of cPanel accounts.
Ordinarily, without root access, a job run by a cPanel account cannot listen on port 80. Indeed, the available ports might be quite restrictive. If 8080 doesn't work, you might try 60000. To access a running node.js server, you'll need to have the port number it's listening on. Since that is the only job listening on that port on that server, you should be able to point your browser to the domain name of any of the cPanel accounts or even the IP address of the server, adding the port number to the URL. But, it's typical to use the domain name for the cPanel account running the node.js job, e.g. http://cPanelDomainName.com:60000/ .
Of course port 80 is the default for web services, and relatively few users are familiar with optional port numbers in URLs. To make things easier for users, you can use Apache to "reverse proxy" requests on port 80 to the port that the node.js process is listening on. This can be done using Apache's RewriteRule directive in a configuration or .htaccess file. This reverse proxying of requests arguably has other benefits as well, e.g. Apache may be a more secure, reliable and manageable front-end for facing the public Internet.
Unfortunately, this setup for node.js is not endorsed by all web hosting companies. One hosting company that supports it, even on its inexpensive shared hosting offerings, is A2Hosting.com. They also have a clearly written description of the setup process in their Knowledge Base.
Finally, it's worth noting that the developers of cPanel are working on built-in node.js support. "If all of the stars align we might see this land as soon as version 68," i.e. perhaps early 2018.
References
Apache Virtual Hosting -
http://httpd.apache.org/docs/2.4/vhosts/
Apache RewriteRule Directive - http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html
A2Hosting.com Knowledge Base Article on Configuring Node.js - https://www.a2hosting.com/kb/installable-applications/manual-installations/installing-node-js-on-managed-hosting-accounts
cPanel Feature Request Thread for node.js Support - https://features.cpanel.net/topic/nodejs-hosting
Related StackOverflow Questions
How to host a Node.Js application in shared hosting
Why node.js can't run on shared hosting?
Is worth to point out that the NodeJS support hasn't yet come to cPanel (as early 2019)

Static ip for application deployed on IBM BlueMix for connecting to SMTP Server

I have deployed an application on IBM BlueMix. The application needs to use a smtp server for sending emails. The smtp server will only allow requests from a static ip. As the application is on the cloud, it may not always have a static ip.
In IBM Bluemix there is a service called as Statica, however that is as per the example only for http and https requests. How can we get a static ip for the application to connect to a smtp server?
Your best best for something like this would probably be to use an SMTP server that accepts some kind of login credentials - having the source IP be static is probably not going to be a tenable solution if you're running an app in the CloudFoundry apps on BlueMix.
If you need a static IP, I'd consider running your apps in the container service, or on a virtual.

How to access remote MySQL database from Heroku?

We have a legacy application running in a shared hosting service (JustHost). Due to which I am not able to write any newer technology apps easily.
I have created a test heroku app to talk to the MySQL database that is in the remote server. I have followed the steps from the Heroku side, with respect to adding the remote db url, etc.
But my hosting service allows remote access only from whitelisted IP address (as it should). How does one get a public IP (or IP range) for a Heroku app?
You can try some sort of proxy node with a static IP that securely communicates to your Heroku app
Did you try to search heroku addons for providing static IP? or try this one https://devcenter.heroku.com/articles/quotaguardstatic