Skip to content

Instantly share code, notes, and snippets.

View thoughtspeed7's full-sized avatar

Raj Chaudhary thoughtspeed7

View GitHub Profile
@thoughtspeed7
thoughtspeed7 / app.yaml
Created May 23, 2018 13:57
Apollo GraphQL Server on Google App Engine in under 5 minutes!
# om namah shivay
# see https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml for more info
runtime: nodejs
env: flex
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
@thoughtspeed7
thoughtspeed7 / hello.go
Created June 5, 2018 15:11
Node, Python and Go in a single Google App Engine project!
// om namah shivay
package main
import (
"net/http"
"log"
"encoding/json"
)
@thoughtspeed7
thoughtspeed7 / go-app.yaml
Created June 5, 2018 15:23
Node, Python and Go in a single Google App Engine project!
# om namah shivay
# See https://cloud.google.com/appengine/docs/flexible/go/configuring-your-app-with-app-yaml
# and https://cloud.google.com/appengine/docs/flexible/go/reference/app-yaml for more info
runtime: go
env: flex
service: go
# The settings below are to reduce costs during testing and not appropriate for production use.
@thoughtspeed7
thoughtspeed7 / hello.py
Created June 5, 2018 15:31
Node, Python and Go in a single Google App Engine project!
# om namah shivay
from flask import Flask
from flask import jsonify
app = Flask(__name__)
@app.route('/')
def hello():
dictionary = {'message': 'Hello from Python!'}
@thoughtspeed7
thoughtspeed7 / python-app.yaml
Created June 5, 2018 15:33
Node, Python and Go in a single Google App Engine project!
# om namah shivay
# See https://cloud.google.com/appengine/docs/flexible/python/configuring-your-app-with-app-yaml
# and https://cloud.google.com/appengine/docs/flexible/python/reference/app-yaml for more info
runtime: python
runtime_config:
python_version: 3
env: flex
service: python
@thoughtspeed7
thoughtspeed7 / requirements.txt
Created June 5, 2018 15:37
Node, Python and Go in a single Google App Engine project!
Flask==1.0.2
gunicorn==19.8.1
@thoughtspeed7
thoughtspeed7 / hello.js
Created June 5, 2018 18:46
Node, Python and Go in a single Google App Engine project!
// om namah shivay
const express = require('express');
const app = express();
app.use('/', (req, res) => {
res.json({ 'message': 'Hello from Node!' });
});
@thoughtspeed7
thoughtspeed7 / package.json
Created June 5, 2018 18:48
Node, Python and Go in a single Google App Engine project!
{
"name": "node",
"version": "1.0.0",
"description": "",
"main": "hello.js",
"scripts": {
"start": "node hello.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Raj Chaudhary",
@thoughtspeed7
thoughtspeed7 / node-app.yaml
Created June 6, 2018 08:23
Node, Python and Go in a single Google App Engine project!
# om namah shivay
# See https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml
# and https://cloud.google.com/appengine/docs/flexible/nodejs/reference/app-yaml for more info
runtime: nodejs
env: flex
service: default
# The settings below are to reduce costs during testing and not appropriate for production use.
@thoughtspeed7
thoughtspeed7 / aws-sdk-node-best-practices-non-optimized.js
Created June 11, 2018 08:33
AWS SDK for Node.js Best Practices
// om namah shivay
// imports the entire AWS SDK
const aws = require('aws-sdk');
aws.config.update({
region: 'us-east-1',
endpoint: 'https://dynamodb.us-east-1.amazonaws.com'
});