mod.ts 781 B

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