Skip to content

Commit 1d777fe

Browse files
fix: http headers issue
1 parent 8ab2b46 commit 1d777fe

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

netlify-functions/getBlogs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
const axios = require("axios");
22
const xml2js = require("xml2js");
33

4-
exports.handler = async (event, context, callback) => {
4+
exports.handler = async () => {
55
const mediumURL = "https://medium.com/feed/codeuino";
66
try {
77
const response = await axios.get(`${mediumURL}`);
88
const data = response.data;
99
xml2js.parseString(data, (err, result) => {
1010
const sendthis = result.rss.channel[0].item.slice(0, 3);
11-
callback(null, {
11+
return ( {
1212
statusCode: 200,
1313
headers: {
1414
"Access-Control-Allow-Origin": "*"

netlify-functions/getLikedTweets.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
const TwitterAxios = require("../src/helpers/twitterAxios");
22

3-
exports.handler = async (event, context, callback) => {
3+
exports.handler = async () => {
44
try {
55
const likedTweetsResponse = await TwitterAxios.get(
66
"/favorites/list.json?count=50&screen_name=codeuino"
77
);
88

9-
callback(null, {
9+
return ({
1010
statusCode: 200,
1111
headers: {
1212
"Access-Control-Allow-Origin": "*"

netlify-functions/getTweets.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
const TwitterAxios = require("../src/helpers/twitterAxios");
22

3-
exports.handler = async (event, context, callback) => {
3+
exports.handler = async () => {
44
try {
55
const allTweetsResponse = await TwitterAxios.get(
66
"/statuses/user_timeline.json?screen_name=codeuino&count=100"
77
);
88

9-
callback(null, {
9+
return ({
1010
statusCode: 200,
1111
headers: {
1212
"Access-Control-Allow-Origin": "*"

0 commit comments

Comments
 (0)