Skip to content

Instantly share code, notes, and snippets.

View thoughtspeed7's full-sized avatar

Raj Chaudhary thoughtspeed7

View GitHub Profile
@thoughtspeed7
thoughtspeed7 / index.js
Created August 15, 2021 10:46
Run Google Cloud Functions Everywhere Using Functions Framework
// om namah shivaya
exports.helloWorld = (req, res) => {
res.send('Hello, World!');
};
@thoughtspeed7
thoughtspeed7 / package.json
Created August 15, 2021 10:45
Run Google Cloud Functions Everywhere Using Functions Framework
{
"name": "functions-framework-demo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "functions-framework --target=helloWorld"
},
"keywords": [],
"author": "Raj Chaudhary",
@thoughtspeed7
thoughtspeed7 / index.js
Created August 13, 2021 09:06
Apollo GraphQL Server 3 On Google Cloud Functions
// om namah shivaya
const { ApolloServer, gql } = require('apollo-server-cloud-functions');
// dummy data
const countries = [
{
code: 'IN',
name: 'India',
},
@thoughtspeed7
thoughtspeed7 / package.json
Created August 13, 2021 06:32
Apollo GraphQL Server 3 On Google Cloud Functions
{
"name": "apollo-server-3-gcf",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Raj Chaudhary",
@thoughtspeed7
thoughtspeed7 / .dockerignore
Created August 11, 2021 10:42
Apollo GraphQL Server 3 Using Express On Google Cloud Run
# om namah shivaya
# directories
node_modules
# files
.dockerignore
.gitignore
.prettierrc
Dockerfile
@thoughtspeed7
thoughtspeed7 / Dockerfile
Created August 11, 2021 10:02
Apollo GraphQL Server 3 Using Express On Google Cloud Run
# om namah shivaya
# Use the official lightweight Node.js 14 image.
# https://hub.docker.com/_/node
FROM node:14-slim
# Create and change to the app directory.
WORKDIR /usr/src/app
# Copy application dependency manifests to the container image.
@thoughtspeed7
thoughtspeed7 / index.js
Created August 11, 2021 09:57
Apollo GraphQL Server 3 Using Express On Google Cloud Run
// om namah shivaya
const { ApolloServer, gql } = require('apollo-server-express');
const express = require('express');
// dummy data
const countries = [
{
code: 'IN',
name: 'India',
@thoughtspeed7
thoughtspeed7 / package.json
Created August 11, 2021 09:54
Apollo GraphQL Server 3 Using Express On Google Cloud Run
{
"name": "apollo-server-3-express-gcr",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Raj Chaudhary",
@thoughtspeed7
thoughtspeed7 / app.yaml
Created August 9, 2021 19:35
Apollo GraphQL Server 3 Using Express On Google App Engine
# om namah shivaya
service: default
runtime: nodejs14
instance_class: F1
automatic_scaling:
min_instances: 0
max_instances: 1
target_cpu_utilization: 0.90
handlers:
@thoughtspeed7
thoughtspeed7 / index.js
Created August 9, 2021 09:55
Apollo GraphQL Server 3 Using Express On Google App Engine
// om namah shivaya
const { ApolloServer, gql } = require('apollo-server-express');
const express = require('express');
// dummy data
const countries = [
{
code: 'IN',
name: 'India',