mirror of
https://github.com/aculix/vector-drawable-nextjs.git
synced 2025-12-06 06:08:24 +00:00
15 lines
352 B
JavaScript
15 lines
352 B
JavaScript
const axios = require('axios')
|
|
|
|
module.exports = async (req, res) => {
|
|
const { method, body, url } = req.body;
|
|
if (method == 'GET') {
|
|
const { data } = await axios.get(url);
|
|
return res.send(data);
|
|
}
|
|
|
|
if (method == 'POST') {
|
|
const { data } = await axios.post(url, body);
|
|
return res.send(data);
|
|
}
|
|
};
|