mod.ts 817 B

1234567891011121314151617181920
  1. import { Color, secret } from './deps.ts'
  2. const date = () => new Date().toLocaleTimeString('de')
  3. const VERSION = 'v1.6.0'
  4. // give your tinyscale server a secret so it looks like a BBB server
  5. if (!secret) throw "No secret set for tinyscale"
  6. console.log(date() + Color.green(` Starting tinyscale ${VERSION}`))
  7. console.log(`Your secret is set to ${Color.green(secret)}`)
  8. import app from "./app.ts";
  9. // Get the PORT from the environment variables and store in Opine.
  10. const port = parseInt(Deno.env.get("PORT") ?? "3005");
  11. app.set("port", port);
  12. // Get the DENO_ENV from the environment variables and store in Opine.
  13. const env = Deno.env.get("DENO_ENV") ?? "development";
  14. app.set("env", env);
  15. // Start our Opine server on the provided or default port.
  16. app.listen(port, () => console.log(`listening on port ${port}`));