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('@google-cloud/functions-framework'); | |
functions.http('test_three', async (req, res) => { | |
// Writes some log entries | |
console.log(JSON.stringify({severity: 'INFO', message: 'info log'})); | |
console.log(JSON.stringify({severity: 'WARNING', message: 'warn log'})); | |
console.log(JSON.stringify({severity: 'ERROR', message: 'error log'})); | |
console.log(JSON.stringify({ | |
severity: 'ERROR', | |
message: new Error('js error').stack |
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('@google-cloud/functions-framework'); | |
// Imports the Google Cloud client library | |
const {Logging} = require('@google-cloud/logging'); | |
functions.http('test_two', async (req, res) => { | |
// Init Logging and set current context | |
const logging = new Logging(); | |
await logging.setProjectId(); | |
await logging.setDetectedResource(); |
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('@google-cloud/functions-framework'); | |
const bunyan = require('bunyan'); | |
// Imports the Google Cloud client library for Bunyan | |
const {LoggingBunyan} = require('@google-cloud/logging-bunyan'); | |
// Creates a Bunyan Cloud Logging client | |
const loggingBunyan = new LoggingBunyan(); | |
// Create a Bunyan logger that streams to Cloud Logging |
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
> mysql -hlocalhost --protocol=TCP -u root --password=test testdb < seed-test-data.sql | |
> mysql -hlocalhost --protocol=TCP -u root -p | |
mysql> SELECT * FROM testdb.users; | |
+----+-------------+ | |
| id | name | | |
+----+-------------+ | |
| 1 | Jon Doe | | |
| 2 | Mr Anderson | |
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
-- MySQL dump 10.13 Distrib 8.0.25, for macos11 (x86_64) | |
-- | |
-- Host: 127.0.0.1 Database: testdb | |
-- ------------------------------------------------------ | |
-- Server version 8.0.27 | |
-- | |
-- Table structure for table `users` | |
-- |
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
mysql> show databases; | |
+--------------------+ | |
| Database | | |
+--------------------+ | |
| information_schema | | |
| mysql | | |
| performance_schema | | |
| sys | | |
| testdb | | |
+--------------------+ |
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
> mysql -h localhost --protocol=TCP -u root -p | |
Enter password: | |
mysql> |
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
version: '3.3' | |
services: | |
db: | |
image: mysql/mysql-server:8.0 | |
restart: always | |
environment: | |
MYSQL_DATABASE: 'testdb' | |
MYSQL_ROOT_PASSWORD: 'test' | |
MYSQL_ROOT_HOST: '%' |
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 composer -v | |
Docker version 20.10.8, build 3967b7d |
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 { ApolloServer, gql } = require('apollo-server'); | |
const {GraphQLErrorTrackingExtension} = require('graphql-error-tracking-extension'); | |
const {ErrorReporting} = require('@google-cloud/error-reporting'); | |
const errorReporting = new ErrorReporting(); | |
/* | |
* ---------------------------------------- | |
* Let's define some custom errors | |
* ---------------------------------------- | |
*/ |
NewerOlder