Add other backend API proxy logic

This commit is contained in:
2020-06-01 17:01:35 +02:00
parent 15d25994c6
commit 434d4dfb4a
4 changed files with 50 additions and 4 deletions

View File

@@ -2,7 +2,7 @@ import TableEntry from "../models/TableEntry";
export default class UserStatsService {
private apiURL = '/stats'
private apiURL = '/api/stats'
private requestInit: RequestInit = {
headers: {

View File

@@ -0,0 +1,10 @@
const { createProxyMiddleware } = require('http-proxy-middleware');
module.exports = function(app) {
app.use(
'/api',
createProxyMiddleware({
target: 'https://api.tsotr.humenius.me',
changeOrigin: true,
})
);
};