able-baker/run.tsx

33 lines
551 B
TypeScript
Raw Permalink Normal View History

2023-07-30 09:16:17 -04:00
import * as Serve from "./run-serve.tsx";
2023-07-30 13:04:26 -04:00
export default function(config:Serve.ConfigurationArgs)
{
if(Deno.env.get("deploy"))
{
return;
}
Serve.Configure(config)
Serve.default();
}
2023-07-30 09:16:17 -04:00
Deno.args.forEach(arg=>
{
if(arg.startsWith("--"))
{
const kvp = arg.substring(2).split("=");
Deno.env.set(kvp[0], kvp[1] || "true");
}
});
2023-07-30 13:04:26 -04:00
if(Deno.env.get("dep"))
2023-07-30 09:16:17 -04:00
{
2023-07-30 13:04:26 -04:00
import("./run-deploy.tsx");
}
else
{
if(Deno.env.get("dev"))
{
await import("./run-local.tsx");
}
Serve.default();
2023-07-30 09:16:17 -04:00
}