mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
cors
This commit is contained in:
2
server/public/assets/dist/embed.min.js
vendored
2
server/public/assets/dist/embed.min.js
vendored
File diff suppressed because one or more lines are too long
2
server/public/assets/dist/main.min.js
vendored
2
server/public/assets/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -233,7 +233,6 @@ var Frontpage = {
|
||||
},
|
||||
|
||||
get_frontpage_lists: function() {
|
||||
console.log(window.location.hostname);
|
||||
var add = "";
|
||||
if(window.location.hostname == "fb.zoff.me") {
|
||||
add = "https://zoff.me";
|
||||
@@ -393,6 +392,10 @@ function initfp() {
|
||||
}
|
||||
};
|
||||
|
||||
if(window.location.hostname == "fb.zoff.me") {
|
||||
$("footer").addClass("hide");
|
||||
}
|
||||
|
||||
channel_list = $("#channel-list-container").clone().html();
|
||||
|
||||
if(window.location.hostname != "fb.zoff.me") share_link_modifier_frontpage();
|
||||
|
||||
@@ -195,6 +195,10 @@ function init(){
|
||||
onepage_load();
|
||||
};
|
||||
|
||||
if(window.location.hostname == "fb.zoff.me") {
|
||||
$("footer").addClass("hide");
|
||||
}
|
||||
|
||||
if(window.location.hostname != "fb.zoff.me") share_link_modifier_channel();
|
||||
if(window.location.hostname == "zoff.me" || window.location.hostname == "fb.zoff.me") add = "https://zoff.me";
|
||||
else add = window.location.hostname;
|
||||
|
||||
@@ -47,6 +47,9 @@ router.route('/:channel_name').get(function(req, res, next){
|
||||
});
|
||||
|
||||
router.route('/api/frontpages').get(function(req, res) {
|
||||
res.header("Access-Control-Allow-Origin", "*");
|
||||
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
||||
|
||||
db.collection("frontpage_lists").find({frontpage: true, count: {$gt: 0}}, function(err, docs) {
|
||||
db.collection("connected_users").find({"_id": "total_users"}, function(err, tot) {
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
@@ -56,6 +59,9 @@ router.route('/api/frontpages').get(function(req, res) {
|
||||
});
|
||||
|
||||
router.route('/api/list/:channel_name').get(function(req, res) {
|
||||
res.header("Access-Control-Allow-Origin", "*");
|
||||
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
||||
|
||||
var channel_name = req.params.channel_name;
|
||||
db.collection(channel_name).find({views: {$exists: false}}, {added: 1, id: 1, title: 1, votes: 1, duration: 1, type: 1, _id: 0}, function(err, docs) {
|
||||
if(docs.length > 0) {
|
||||
@@ -69,6 +75,9 @@ router.route('/api/list/:channel_name').get(function(req, res) {
|
||||
});
|
||||
|
||||
router.route('/api/conf/:channel_name').get(function(req, res) {
|
||||
res.header("Access-Control-Allow-Origin", "*");
|
||||
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
||||
|
||||
var channel_name = req.params.channel_name;
|
||||
db.collection(channel_name).find({views: {$exists: true}},
|
||||
{
|
||||
@@ -107,6 +116,9 @@ router.route('/api/conf/:channel_name').get(function(req, res) {
|
||||
});
|
||||
|
||||
router.route('/api/imageblob').post(function(req, res) {
|
||||
res.header("Access-Control-Allow-Origin", "*");
|
||||
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
||||
|
||||
var Jimp = require("jimp");
|
||||
Jimp.read('https://img.youtube.com/vi/' + req.body.id + '/mqdefault.jpg', function (err, image) {
|
||||
if (err) console.log(err);
|
||||
|
||||
Reference in New Issue
Block a user