2023-07-30 09:16:17 -04:00
|
|
|
import * as Serve from "./run-serve.tsx";
|
2023-07-30 13:04:26 -04:00
|
|
|
|
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 14:01:14 -04:00
|
|
|
const isDeploy = Deno.env.get("dep");
|
|
|
|
const isDevelop = Deno.env.get("dev");
|
|
|
|
|
|
|
|
export default function(config:Serve.ConfigurationArgs)
|
|
|
|
{
|
|
|
|
if(!isDeploy)
|
|
|
|
{
|
|
|
|
Serve.Configure(config)
|
|
|
|
Serve.default();
|
|
|
|
}
|
|
|
|
}
|
2023-07-30 09:16:17 -04:00
|
|
|
|
2023-11-06 15:45:47 -05:00
|
|
|
if(isDevelop)
|
2023-07-30 09:16:17 -04:00
|
|
|
{
|
2023-11-06 15:45:47 -05:00
|
|
|
await import("./run-local.tsx");
|
2023-07-30 13:04:26 -04:00
|
|
|
}
|
2023-11-06 15:45:47 -05:00
|
|
|
Serve.default();
|