attempt to configure mimetype for ajax calls

This commit is contained in:
Michael Q Larson
2015-02-17 14:52:46 -08:00
parent ca9658bf16
commit 09e9dcefe0
2 changed files with 4 additions and 1 deletions

View File

@ -121,6 +121,7 @@ module.exports = {
bloggerCalls: function(req, res) {
client.get('https://www.googleapis.com/blogger/v3/blogs/2421288658305323950/posts?key=' + secrets.blogger.key, function (blog, res5) {
var blog = blog.length > 100 ? JSON.parse(blog) : "";
res.type("application/javascript");
res.send({
blog1Title: blog ? blog["items"][0]["title"] : "Can't connect to Blogger",
blog1Link: blog ? blog["items"][0]["url"] : "http://blog.freecodecamp.com",

View File

@ -3,7 +3,9 @@ script.
(function() {
$.ajax({
url: 'http://freecodecamp.com/api/blogger',
type: 'GET'
type: 'GET',
crossDomain: true,
dataType: 'jsonp'
}).done(
function(data) {
var props = Object.keys(data);