Random Link ¯\_(ツ)_/¯ | ||
Apr 20, 2024 | » | Of Builds and Bundlers
3 min; updated Apr 20, 2024
Moving to TypeScript entails configuring how the JavaScript will be eventually consumed by both the server and the client. Separating the Client Bundle from the Server Bundle The server code runs in Node while the client code runs in the browser. advises separating the configurations for advantages like faster type-checking and compiling, lower memory usage when using an editor, and improved enforcement of the logical groupings of your program.... |
Apr 19, 2024 | » | Client/Server Interface
8 min; updated Apr 19, 2024
How to handle redirects without setting window.location.href? Right now, there’s a pattern of doing: sendHTTPRequest("POST", "/login/", {}) .then((_) => { window.location.href = "/"; }) .catch((err) => { console.error(err); }); Isn’t this something that the server can do? In response, why not issue a redirect? Screenshot of the redirect chain from /login. The POST request gets a 303 (See Other) redirect to /home. The browser then makes a GET request to /home, which results in a 304 (Not Modified).... |