Created
January 13, 2020 13:59
-
-
Save nixjs/01b78dc0e32512ee11611258b9a555b4 to your computer and use it in GitHub Desktop.
Config nodejs with firebase functions and apollo server express
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
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