如何测试本地主机上的打开图 [英] how to test open graph on localhost

查看:132
本文介绍了如何测试本地主机上的打开图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了很多研究,没有找到确切的答案。有没有办法测试本地主机上的开放图表?我不会在locahost上使用图形API来避免任何问题。



我已经在应用设置中更改了我的网站网址,甚至尝试在我的主机文件中设置域,但打开的图形的调试器linter会尝试使用实际的域而不是我的本地主机,当直接使用locahost时,linter完全连接失败。



有人有任何解决方法吗?

解决方案

使用 ngrock 创建一个随机的公共子网域,即使通过NAT或防火墙也能轻松地路由到本地Web服务器。



只需下载ngrok并运行 ./ ngrok http 8080 (假设8080是您本地的Web服务器http端口)。



这将创建一个随机的子域,如 http:// 38a84a97。 ngrok.io/ 路由到您当地的网络服务器,您可以使用Facebook来测试您的开放图表标签。


I've done a lot of research and haven't found a definitive answer to this. Is there anyway to test the open graph on localhost? I don't haven any issues using the graph api on locahost.

I've changed my website url in the app settings and have even tried setting up a domain in my hosts file but the debugger linter for open graph tries to use the actual domain instead of my localhost and when using locahost directly the linter completely fails connecting.

Does anybody have any workarounds for this?

解决方案

You can use ngrock to create a random public subdomain that routes to your local webserver very easily, even through NAT or firewalls.

Just download ngrok and run ./ngrok http 8080 (assuming 8080 is your local webserver http port).

This will create a random subdomain like http://38a84a97.ngrok.io/ that routes to your local webserver and that you can use with Facebook to test your open graph tags.

这篇关于如何测试本地主机上的打开图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆