mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 16:55:37 +02:00
This adds: - [x] Keyboard and mouse handling on the frontend - [x] Video and audio streaming from the backend to the frontend - [x] Input server that works with Websockets Update - 17/11 - [ ] Master docker container to run this - [ ] Steam runtime - [ ] Entrypoint.sh --------- Co-authored-by: Kristian Ollikainen <14197772+DatCaptainHorse@users.noreply.github.com> Co-authored-by: Kristian Ollikainen <DatCaptainHorse@users.noreply.github.com>
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
/*
|
|
* WHAT IS THIS FILE?
|
|
*
|
|
* It's the entry point for the Deno HTTP server when building for production.
|
|
*
|
|
* Learn more about the Deno integration here:
|
|
* - https://qwik.dev/docs/deployments/deno/
|
|
* - https://docs.deno.com/runtime/tutorials/http_server
|
|
*
|
|
*/
|
|
import { createQwikCity } from "@builder.io/qwik-city/middleware/deno";
|
|
import qwikCityPlan from "@qwik-city-plan";
|
|
import { manifest } from "@qwik-client-manifest";
|
|
import render from "./entry.ssr";
|
|
|
|
// Create the Qwik City Deno middleware
|
|
const { router, notFound, staticFile } = createQwikCity({
|
|
render,
|
|
qwikCityPlan,
|
|
manifest,
|
|
});
|
|
|
|
// Allow for dynamic port
|
|
const port = Number(Deno.env.get("PORT") ?? 3009);
|
|
|
|
/* eslint-disable */
|
|
console.log(`Server starter: http://localhost:${port}/app/`);
|
|
|
|
Deno.serve({ port }, async (request: Request, info: any) => {
|
|
const staticResponse = await staticFile(request);
|
|
if (staticResponse) {
|
|
return staticResponse;
|
|
}
|
|
|
|
// Server-side render this request with Qwik City
|
|
const qwikCityResponse = await router(request, info);
|
|
if (qwikCityResponse) {
|
|
return qwikCityResponse;
|
|
}
|
|
|
|
// Path not found
|
|
return notFound(request);
|
|
});
|
|
|
|
declare const Deno: any;
|