mirror of
https://github.com/MisskeyIO/misskey
synced 2024-12-12 13:48:23 +09:00
16 lines
351 B
TypeScript
16 lines
351 B
TypeScript
import * as express from 'express';
|
|
import * as request from 'request';
|
|
import xml2json = require('xml2json');
|
|
|
|
module.exports = (req: express.Request, res: express.Response) => {
|
|
const url: string = req.body.url;
|
|
|
|
request(url, (err, response, xml) => {
|
|
if (err) {
|
|
res.sendStatus(500);
|
|
} else {
|
|
res.send(xml2json.toJson(xml));
|
|
}
|
|
});
|
|
};
|