Created
November 18, 2021 18:19
-
-
Save lydemann/b5e45412f038fc0b044c499b07ae2fc1 to your computer and use it in GitHub Desktop.
main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { region } from 'firebase-functions'; | |
import { gqlServer } from './app/server'; | |
import { environment } from './environments/environment'; | |
const dotenvJSON = require('dotenv-json'); | |
if (environment.production) { | |
dotenvJSON({ path: __dirname + '/assets/env.json' }); | |
} else { | |
dotenvJSON({ path: __dirname + '/assets/env.local.json' }); | |
} | |
const server = gqlServer(); | |
// Graphql api | |
// https://us-central1-<project-name>.cloudfunctions.net/api/ | |
const api = region('europe-west3').https.onRequest(server); | |
export { api }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment