fix: remote host
This commit is contained in:
parent
2830764f9f
commit
853f9f1fb4
|
@ -1,5 +1,13 @@
|
|||
import {useLoaderData} from '@remix-run/react';
|
||||
|
||||
import styles from './index.module.css';
|
||||
|
||||
export function loader({request}) {
|
||||
return {
|
||||
host: new URL(request.url).host,
|
||||
};
|
||||
}
|
||||
|
||||
export const meta = () => {
|
||||
return [
|
||||
{
|
||||
|
@ -13,12 +21,13 @@ export const meta = () => {
|
|||
};
|
||||
|
||||
export default function Index() {
|
||||
const {host} = useLoaderData();
|
||||
return (
|
||||
<div>
|
||||
<h1 className={styles.title}>Silphius</h1>
|
||||
<ul className={styles.actions}>
|
||||
<li><a href="/play/local">Single-player</a></li>
|
||||
<li><a href="/play/remote/localhost:3000">Multi-player</a></li>
|
||||
<li><a href={`/play/remote/${host}`}>Multi-player</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue
Block a user