Skip to content

Instantly share code, notes, and snippets.

@nixjs
Created January 13, 2020 13:59
Show Gist options
  • Save nixjs/01b78dc0e32512ee11611258b9a555b4 to your computer and use it in GitHub Desktop.
Save nixjs/01b78dc0e32512ee11611258b9a555b4 to your computer and use it in GitHub Desktop.
Config nodejs with firebase functions and apollo server express
const functions = require("firebase-functions");
const express = require("express");
const { ApolloServer } = require("apollo-server-express");
const { schema } = require("./graphql/index");
const app = express();
const server = new ApolloServer({
schema
});
server.applyMiddleware({ app, path: "/", cors: true });
exports.graphql = functions.https.onRequest(app);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment