Skip to content

Instantly share code, notes, and snippets.

@lydemann
Created Nov 18, 2021
Embed
What would you like to do?
main.ts
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