I just started using Cloud 9 with my app. Part of my app has an API that is accessed through a subdomain - api.domain. I was curious if anyone was able to access a subdomain through the application C9 creates when running your rails server?
rails s -p $PORT -b $IP
Thanks in advance!
A rep from c9.io commented on a similar question here: Can I use my own domain with c9.io?
As of now, they still don't support this.
Related
So far I've used web hosting such as https://uk.godaddy.com/hosting/web-hosting for my websites, but seem like running angular 2 app has different way for publication.
So, since I found nothing about running Angular 2 app to be available public, and not only in localhost
My questions are -
What providers do allow such apps to be hosted on them? now I'm using npm start in my project folder to run my app, does it works the same way?
Since my backend is Laravel and supposed to be in the same domain as the Angular2 frontend, These providers allow to host the API's too?
Thanks in advance!
I have also hosted my laravel backend and angular front end using openshift. In terms to your application, I recommend you the following two providers.
Amazon Web Service. You can get 1 year free trial, EC2 is really wonderful to host whatever you want. In EC2, you can configure the environment for angular 2 and laravel by yourself. You can run any command including npm install in EC2
Openshift. You can freely create 3 gears to host your application. The environment is very easy to configure. If you want
to deploy angular 2, laravel applications, there are specific gears for these frameworks, so openshift
should be the best choice.
The answer to your second question : Yes, they allow to host the APIs !
I've been Googling this problem for some weeks now and can't find a solution to what seems to be a simple problem. It seems to get pretty convoluted pretty quickly.
I've read through the node.js Heroku getting started and a lot of other tutorials but it seems to be that it won't work with Polymer. I can see my app looks and works fine when I run python -m http.server 8000 from the command line in my directory I can view my app in the localhost and it looks great!
If anyone has any clue as to where I should go from here or can point me to any useful links that would be amazing! Even better if there is some kind of skeleton Polymer website that is freely available.
If you aren't trying to host a node.js or other backend with your polymer app you can use github pages. https://pages.github.com/
Polymer app is essentially only files that the browser needs to retrieve from remote server. You don't need to have backend on the host server. If you were trying to host node.js or other backend you could use heroku to host it.
I have followed Ryan Bates railscast on subdomains (http://railscasts.com/episodes/123-subdomains-revised) and have my app working perfectly locally.
I have deployed to heroku but am unable to get my subdomains to work. I have read about custom domains, DNS and CNAME records but I don't think this is relevant because all I am trying to do is test straight on heroku what I was testing locally. So instead of accessing myapp.herokapp.com I would like to be able to access m.myapp.herokuapp.com. Currently when I try this I get the error: There is no app configured at that hostname.
Can anyone offer a solution?
UPDATE:
Whoops, I think this is a duplicate: How to create a subsubdomain for an app on heroku: (e.g. sub.myapp.herokuapp.com)
Sub-sub domains aren't possible - you need to be using your own DNS records I'm afraid.
It's really difficult to explain. But basically, I have an amazon instance, and I want to ssh into it and run a local server on it with sinatra. so I would ssh into the amazon instance, git clone my repo, and run ruby config.ru. Then I want someone else to be able to see that exact local server that is being ran. One of the things I've done is added a security group, port 4567 HTTP so that I can access it via public dns. It works on a rack app but it doesn't work on the sinatra, I've even tried a 'hello world' sample app to try to get it working.
I'm not sure if there is a specific reason that you want to do this from an Amazon server or not, but if you just want someone else to see your sinatra app, you could simply use localtunnel.
Using this, you can simply run localhost on your OWN computer, then run localtunnel PORTNUMBER and it will give you a URL that your app will now be visible from. You can then give that URL to anyone you want.
Example of use:
$ ruby myapp.rb
$ localtunnel 4567
A URL will then be displayed for you to copy-paste to a friend. Easy as that.
I use this a lot when developing web apps to be mobile friendly and want to quickly look at the app on my phone without having to deploy to a server.
I have a Heroku application that binds with a telco sms gateway via SMPP
The telco guys need to whitelist IPs for my app to connect.
I am aware of the new addon proximo, but it's just insanely priced. So that option is out.
Is there a subnet or a list of IPs that I can get whitelisted and is there a guarantee that all requests from my app will originate from tose IPs?
I found this https://api.heroku.com/vendor/logplex/allowlist.
Is that only for syslog or all apps make a request from one of those IPs?
Thanks
There is now a Heroku add-on that does this called Proximo: https://addons.heroku.com/proximo
The Heroku docs specifically mention how dynos don't have static IP addresses. Even when using custom domains it looks like they want you to point to a CNAME record rather than an IP address. So if you need a static IP it looks like Proximo is your best bet.
Would it be possible to use an API token to authenticate your app with the sms gateway, similar to the way the blitz.ip plugin works with heroku? Then you might not need to use a static IP whitelist.
This question looks to be doing something similar to you, and this answer suggests using a hosted VPN service. Would that work?
Heroku now has Private Spaces which is what you are looking for:
https://www.heroku.com/private-spaces
Another Heroku addon option is Quotaguard , in beta, free for now.
Answering my own question. Even though an external VPN or the proximo addon are a solution in case you want to whitelist a Heroku app, I have decided to go for the simpler option and host the SMPP binding service of my app on ec2 using an Elastic IP
You can host a proxy yourself using Dockhero Heroku add-on - https://dockhero.io/ - which has a static IP (AWS elastic IP).
Install the add-on and the CLI plugin:
$ heroku addons:create dockhero
$ heroku plugins:install dockhero
Wait until the provisioning is done and get DOCKHERO_HOST environment variable
$ heroku dh:wait
$ heroku config:get DOCKHERO_HOST
--> e.g. dockhero-spherical-42047.dockhero.io
Create dockhero-compose.yml file with the following contents:
version: "2"
services:
proxy:
image: tecnativa/tcp-proxy
environment:
LISTEN: ":80"
TALK: "www.wikipedia.org:80"
ports:
- "80:80"
Here www.wikipedia.org:80 is the server which you build a proxy for.
Find more about the syntax in https://docs.docker.com/compose/compose-file/compose-file-v2/
Run this stack in the cloud using Dockhero CLI:
$ heroku dh:compose up -d
Any requests to the host from DOCKHERO_HOST Heroku config var will now be proxied according to your dockhero-compose.yml
$ curl http://dockhero-spherical-42047.dockhero.io/
--> <response from www.wikipedia.org>
IMPORTANT: as of writing this, dockhero.io is in Beta and available for free. When switching to production, the assigned IP may be changed after a prior notification.
Fixie is another alternative add-on not mentioned here. Free plan with 500 requests per month. Requires some adjustments in code and heroku app to be in us region (or you can migrate it: Migrating an Application to Another Region). Worked for me.