Use the webpack dev server proxy for requests
This commit is contained in:
parent
2a8b474fa1
commit
3b3f785984
@ -11,8 +11,6 @@ import (
|
||||
|
||||
// GetStatus gets the status of the server.
|
||||
func GetStatus(w http.ResponseWriter, r *http.Request) {
|
||||
middleware.EnableCors(w)
|
||||
|
||||
status := core.GetStatus()
|
||||
response := webStatusResponse{
|
||||
Online: status.Online,
|
||||
|
@ -2,4 +2,12 @@ const withLess = require('next-with-less');
|
||||
|
||||
module.exports = withLess({
|
||||
trailingSlash: true,
|
||||
async rewrites() {
|
||||
return [
|
||||
{
|
||||
source: '/api/:path*',
|
||||
destination: 'http://localhost:8080/api/:path*', // Proxy to Backend to work around CORS.
|
||||
},
|
||||
];
|
||||
},
|
||||
});
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { ChatMessage } from '../interfaces/chat-message.model';
|
||||
import { getUnauthedData } from '../utils/apis';
|
||||
const ENDPOINT = `http://localhost:8080/api/chat`;
|
||||
const URL_CHAT_REGISTRATION = `http://localhost:8080/api/chat/register`;
|
||||
const ENDPOINT = `/api/chat`;
|
||||
const URL_CHAT_REGISTRATION = `/api/chat/register`;
|
||||
|
||||
interface UserRegistrationResponse {
|
||||
id: string;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import ServerStatus from '../interfaces/server-status.model';
|
||||
|
||||
const ENDPOINT = `http://localhost:8080/api/status`;
|
||||
const ENDPOINT = `/api/status`;
|
||||
|
||||
class ServerStatusService {
|
||||
public static async getStatus(): Promise<ServerStatus> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user