简体   繁体   English

MEAN.js未在iframe中显示

[英]MEAN.js not showing in iframe

I have to display a MEAN.JS app within an iframe, so I started with a simple html file: 我必须在iframe中显示MEAN.JS应用,因此我从一个简单的html文件开始:

<iframe style="height: 100%; width: 100%;" src="http://localhost:3000/#!/workouts"></iframe>

But then the iframe content is empty, can please somebody help me? 但是iframe内容为空,请有人帮我吗?

Got it: My app is using Helmet ( https://github.com/evilpacket/helmet ) which setted a DENY in the X-Frame-Options. 知道了:我的应用程序使用的是Helmet( https://github.com/evilpacket/helmet ),该头盔在X-Frame-Options中设置了DENY。 So, in my Express configuration I setted: 因此,在我的Express配置中,我设置了:

app.use(helmet.xframe('ALLOW-FROM', 'www.mydomain.com'));

And it worked 而且有效

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM