Skip to content

Instantly share code, notes, and snippets.

View coco98's full-sized avatar

Tanmai Gopal coco98

View GitHub Profile
@coco98
coco98 / simple-query.graphql
Created April 23, 2018 13:51
A simple "read" query in GraphQL
# Fetch authors and their articles
# and relevant fields within those objects only
query {
author {
id
name
articles {
id
title
}
@coco98
coco98 / server2.js
Created May 28, 2017 06:52
A simple server.js with one endpoint
var express = require('express');
var app = express();
//your routes here
app.get('/respond', function (req, res) {
res.send("Hello World!");
});
app.listen(8080, function () {
console.log('Example app listening on port 8080!');
@coco98
coco98 / server.js
Last active May 28, 2017 07:15
Nodejs service on Hasura making an API request to another API on Hasura
const fetch = require('isomorphic-fetch');
const express = require('express');
const app = express();
//your routes here
app.get('/hello', function (req, res) {
const url = 'http://api2.default/respond';
const options = {
method: 'GET'
@coco98
coco98 / kube-registry.yaml
Created May 2, 2017 16:31
Docker registry on minikube
apiVersion: v1
kind: ReplicationController
metadata:
name: kube-registry-v0
namespace: kube-system
labels:
k8s-app: kube-registry
version: v0
spec:
replicas: 1