mirror of
https://github.com/Lissy93/web-check.git
synced 2024-11-23 00:34:21 +01:00
15 lines
389 B
JavaScript
15 lines
389 B
JavaScript
const axios = require('axios');
|
|
const middleware = require('./_common/middleware');
|
|
|
|
const handler = async (url, event, context) => {
|
|
try {
|
|
const response = await axios.get(url, {withCredentials: true});
|
|
const cookies = response.headers['set-cookie'];
|
|
return { cookies };
|
|
} catch (error) {
|
|
throw new Error(error.message);
|
|
}
|
|
};
|
|
|
|
exports.handler = middleware(handler);
|