How to set X-Frame-Options in express.js node.js
all you need is helmet
npm install helmet --save
const express = require('express')
const helmet = require('helmet')
const app = express()
app.use(helmet.frameguard())
You should import helmet and use frameguard to get some origins whitelisted. More on this topic: MDN X-FRAME-OPTIONS Best Practice Security