26 lines
664 B
TypeScript
26 lines
664 B
TypeScript
#!/usr/bin/env -S deno run -A --watch=static/,routes/
|
|
|
|
import { Builder } from 'fresh/dev'
|
|
import { app } from './main.ts'
|
|
|
|
const builder = new Builder()
|
|
const hostname = 'cohabit.localhost'
|
|
|
|
if (Deno.args.includes('build')) {
|
|
await builder.build(app)
|
|
} else {
|
|
await builder.listen(app, {
|
|
cert: await Deno.readTextFile('./cert/cohabit.localhost.pem'),
|
|
key: await Deno.readTextFile('./cert/cohabit.localhost-key.pem'),
|
|
hostname,
|
|
onListen: (({ port }) => {
|
|
console.log(
|
|
`\n%c Server started %c %chttps://${hostname}:${port}\n`,
|
|
'font-weight: bold; background-color: blue',
|
|
'',
|
|
'color: blue; text-decoration: underline',
|
|
)
|
|
}),
|
|
})
|
|
}
|