website/dev.ts

25 lines
635 B
TypeScript
Raw Normal View History

2024-01-14 20:08:59 +01:00
#!/usr/bin/env -S deno run -A --watch=static/,routes/
import dev from '$fresh/dev.ts'
import config from './fresh.config.ts'
import '$std/dotenv/load.ts'
const hostname = 'cohabit.localhost'
await dev(import.meta.url, './main.ts', {
...config,
server: {
cert: await Deno.readTextFile('./cert/cohabit.localhost.pem'),
key: await Deno.readTextFile('./cert/cohabit.localhost-key.pem'),
hostname,
onListen: (({ port }) => {
console.log(
`\n\t%c Server started %c %chttps://${hostname}:${port}\n`,
'font-weight: bold; background-color: blue',
'',
'color: blue; text-decoration: underline',
)
}),
},
})