0
0
mirror of https://github.com/yude-jp/yude.jp synced 2025-10-20 07:08:38 +09:00

Remove /api/PlayerName

This commit is contained in:
2021-12-11 06:42:23 +09:00
parent 33dbec3339
commit a095e20b6b
4 changed files with 2 additions and 26 deletions

View File

@@ -1,23 +0,0 @@
// React
import React, { useState, useEffect } from 'react';
import axios from 'axios';
export const getName = async (props) => {
const uuid = props;
return fetch('https://api.ashcon.app/mojang/v2/user/' + uuid);
};
const RawPlayerName = async (req, res) => {
const { uuid } = req.query
const response = await getName(uuid);
const data = await response.json();
if (response.status === 204 || response.status > 400) {
return res.status(200).send("404");
}
const username = data.username;
return res.status(200).json({
username,
});
};
export default RawPlayerName