Initial commit 🍀
This commit is contained in:
commit
b3f42e62af
405 changed files with 31017 additions and 0 deletions
16
src/web/service/rss-proxy.ts
Normal file
16
src/web/service/rss-proxy.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import * as express from 'express';
|
||||
import * as request from 'request';
|
||||
const xml2json = require('xml2json');
|
||||
|
||||
module.exports = (req: express.Request, res: express.Response) => {
|
||||
const url: string = req.body.url;
|
||||
|
||||
request(url, (err, response, xml) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
return;
|
||||
}
|
||||
|
||||
res.send(xml2json.toJson(xml));
|
||||
});
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue