Deploy Loopback project on hosting space

51 views
Skip to first unread message

Sven

unread,
Jun 10, 2018, 10:25:05 AM6/10/18
to LoopbackJS
Hi,

I created a Loopback API with the loopback-cli and a website with ReactJS. I also bought myself a webspace to host my website, but now I can't seem to understand how I am supposed to get my Loopback API running on my hosting space and access the API on my website. Everything worked fine during development on my pc. Someone here that can help me?

Thanks in advance,
Sven

Uday Kumar

unread,
Jun 10, 2018, 11:02:00 AM6/10/18
to loopb...@googlegroups.com
you will need to do to follow these steps : 
1. install loopback, database(mongo, mysql etc.), forever  on your server.
2. configure your web server for routing your domain
3. create an index.html file at your server and access it from domain (www.xyz.com) , it must display your index.html contents., once it will be verified. you can go ahead.

4. If your webserver will be up,  you must start your database services. 
5. For loopback code : 

  1. dump your local code on server
  2. change your db configuration in datasource.json and config.json e.g., host : 'IP', url:'http://mongodb:user:pass@host/db' etc.
  3. and then start your loopback server.js file using any process automate tool such as , forever, pm2 nodemon etc.
       e.g.,   
               $ sudo forever start server/server.js
   once it will be done , you can verify your server : www.xyz.com/explorer , it will display your all the api in swagger view.
 
For frontend routing,
 Place you frontend bundle inside client folder at server and configure your middleware.json->public routing.

May be these step will help you.




  

--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/eb087892-aadd-454c-8bef-de8472ce3f55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aman Alam

unread,
Jun 10, 2018, 4:35:54 PM6/10/18
to loopb...@googlegroups.com
Also, to add, you'll have to setup your backend hosting to run node.js, since Loopback will run on top of it.
Once you're done setting node.js, and additionally npm (to install packages in the future), then dump your loopback code there, and it should run.

Basically your hosting would be a blank space and you'll have to mimic your local setup there to run loopback.

Let us know how it goes :)


For more options, visit https://groups.google.com/d/optout.



--
Impossible is Nothing 

Aman Alam
Bangalore, IN

Mark Johnson

unread,
Jun 10, 2018, 7:37:50 PM6/10/18
to LoopbackJS
Unless the web hosting service you provided is built for node you're not going to have much luck.  Most web hosting environments are just for standard PHP applications, perhaps running perl or python scripted applications as well.

Unless you have actually acquired a VPS you're probably out of luck with the hosting you acquired.

Aman Alam

unread,
Jun 11, 2018, 6:25:40 AM6/11/18
to loopb...@googlegroups.com
Good point, Mark

On Mon, Jun 11, 2018 at 5:07 AM, Mark Johnson <mjohn...@gmail.com> wrote:
Unless the web hosting service you provided is built for node you're not going to have much luck.  Most web hosting environments are just for standard PHP applications, perhaps running perl or python scripted applications as well.

Unless you have actually acquired a VPS you're probably out of luck with the hosting you acquired.

--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Sven

unread,
Jun 11, 2018, 7:17:24 AM6/11/18
to LoopbackJS
It looks like this is indeed the problem I'm having. I will have to get myself a VPS I guess. Then I can try the steps that Uds214125 and Aman Alam provided. It seems like that will work. Thank you all for your help!

Op maandag 11 juni 2018 01:37:50 UTC+2 schreef Mark Johnson:

Aman Alam

unread,
Jun 11, 2018, 9:09:52 AM6/11/18
to loopb...@googlegroups.com
Is heroku a possible option for you? Because loopback works right out of the box on it

--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/55ae8326-b457-4ef0-9d00-b6e6ece6aeb2%40googlegroups.com.

Sven

unread,
Jun 11, 2018, 9:18:18 AM6/11/18
to LoopbackJS
Not exactly, because I'd like to upload files to my server with Loopback Storage Component and I don't think this is possible with Heroku. Correct me if I'm wrong.

Op maandag 11 juni 2018 15:09:52 UTC+2 schreef Aman Alam:

Uday Kumar

unread,
Sep 6, 2018, 4:15:54 AM9/6/18
to loopb...@googlegroups.com

To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/e63d0f34-43ea-4cd7-9e60-94e406ab8d02%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages