accepting more methods
This commit is contained in:
parent
cf3dc1e7dd
commit
04ca5b3777
1 changed files with 2 additions and 1 deletions
|
@ -7,12 +7,13 @@ async function decodeData(buffer) {
|
||||||
}
|
}
|
||||||
let dat;
|
let dat;
|
||||||
export default async function handler(req, res) {
|
export default async function handler(req, res) {
|
||||||
if (req.method == "GET") {
|
if (req.method == "POST" || req.method == "GET" || req.method == "PUT") {
|
||||||
try {
|
try {
|
||||||
dat = JSON.parse(req.body).ByteData;
|
dat = JSON.parse(req.body).ByteData;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
dat = req.body.ByteData;
|
dat = req.body.ByteData;
|
||||||
}
|
}
|
||||||
|
console.log(dat);
|
||||||
if (dat == undefined)
|
if (dat == undefined)
|
||||||
res.status(400).json({error: "ByteData is undefined"});
|
res.status(400).json({error: "ByteData is undefined"});
|
||||||
const data = await getItemNetworth((await decodeData(dat)).i[0], {
|
const data = await getItemNetworth((await decodeData(dat)).i[0], {
|
||||||
|
|
Loading…
Reference in a new issue