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
fetch('http://example.com/todos') | |
.then(function(response) { | |
// some data processing | |
const first_todo = response.todos[0].text; | |
return first_todo; | |
}) | |
.then(function(myJson) { | |
console.log(JSON.stringify(myJson)); | |
}); |
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
docker run -d --name dd-agent -v /var/run/docker.sock:/var/run/docker.sock:ro -v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -e DD_API_KEY=<your-api-key> datadog/agent:latest |
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
docker run -d -v /var/run/docker.sock:/var/run/docker.sock:ro \ | |
-v /proc/:/host/proc/:ro \ | |
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \ | |
-e DD_API_KEY=<YOUR_API_KEY> \ | |
-e DD_APM_ENABLED=true \ | |
datadog/agent:latest |
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
var tracer = require('dd-trace').init({ | |
hostname: '<host-name>', | |
port: 8126, | |
debug: true | |
}); | |
tracer.use('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
require("honeycomb-beeline")({ | |
writeKey: "<your-write-key>", | |
dataset: "node-js" | |
// ... additional optional configuration ... | |
}); |
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
FROM python:3.6 | |
# Create app directory | |
WORKDIR /app | |
# Install app dependencies | |
COPY gunicorn_app/requirements.txt ./ | |
RUN pip install -r requirements.txt |
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
<template> | |
<div> | |
<h3>Authors</h3> | |
<ul> | |
<li v-for="item in author" :key="item.id"> | |
<nuxt-link :to="`/article/${item.id}`"> | |
{{ item.name }} | |
</nuxt-link> | |
</li> | |
</ul> |
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
import client from './src/apollo' | |
import {GET_AUTHOR, GET_ARTICLE} from './src/graphql/queries' | |
export default { | |
getSiteData: () => ({ | |
title: 'React Static with Hasura GraphQL', | |
}), | |
getRoutes: async () => { | |
const { | |
data: { author }, |
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
<script context="module"> | |
import gql from 'graphql-tag'; | |
import { client } from './apollo'; | |
const ARTICLES = gql` | |
{ | |
article { | |
id | |
title | |
author { |
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
module.exports = { | |
"schema": [ | |
{ | |
"http://localhost:8080/v1/graphql": { | |
"headers": { | |
// neccessary auth headers to fetch schema | |
} | |
} | |
} | |
], |