[英]I've created a node app through cloud 9, but how do I connect my app with my website?
I've made a Node.js app, and it functions on Cloud 9 as an HTML page, but I want to move it to a web address that I currently own and for the life of me I can't seem to figure out how to link the backend to the front end. 我已经制作了一个Node.js应用程序,它在Cloud 9上可以作为HTML页面运行,但是我想将其移动到我目前拥有的网址中,对于我一生,我似乎无法弄清楚将后端链接到前端。 I'm going to try to deploy the backend to a Heroku server, but how would I go about getting my app to display on a web address that I currently own?
我将尝试将后端部署到Heroku服务器,但是如何使我的应用程序显示在当前拥有的网址上?
Cloud9 does not allow for public hosting of websites: see here . Cloud9不允许公共托管网站: 请参阅此处 。 You cannot point your own domain name to a cloud9 workspace.
您不能将自己的域名指向cloud9工作区。
If you're already moving a part of your app to Heroku, why not move the rest of it? 如果您已经将应用程序的一部分移至Heroku,为什么不将其其余部分移至此? Heroku provides hosting services, and you can point your domain there.
Heroku提供托管服务,您可以将您的域名指向那里。 See here for a tutorial on how to do that.
有关如何执行此操作的教程,请参见此处 。
Otherwise, if you have two separate apps, you can point your domain to the Heroku app, and then set up a redirect on the route/subdomain to take the user to the cloud9 app. 否则,如果您有两个单独的应用程序,则可以将您的域指向Heroku应用程序,然后在路由/子域上设置重定向以将用户带到cloud9应用程序。 This is bad practice, but it works.
这是不好的做法,但是可以。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.