This file contains hidden or 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.1' | |
| services: | |
| db: | |
| image: mariadb | |
| restart: always | |
| environment: | |
| MYSQL_ROOT_PASSWORD: example | |
| MYSQL_DATABASE: mydb |
This file contains hidden or 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
| CREATE TABLE student | |
| ( | |
| id bigint NOT NULL, | |
| name text COLLATE pg_catalog."default", | |
| CONSTRAINT student_pkey PRIMARY KEY (id) | |
| ); | |
| INSERT INTO student(id, name) VALUES | |
| (1, 'A'), | |
| (2, 'B'), |
This file contains hidden or 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
| AWS_COGNITO_USER_POOL_ID=ap-southeast-1_OYnSpz7Zo | |
| AWS_COGNITO_CLIENT_ID=21uj81kemk1of3usp9gm3alcq5 | |
| AWS_COGNITO_REGION=ap-southeast-1 | |
| AWS_COGNITO_IDENTITY_POOL_ID=ap-southeast-1:73057fab-16a2-4e42-b2f0-ce6f56928db1 |
This file contains hidden or 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 AWS = require('aws-sdk'); | |
| const jwt_decode = require('jwt-decode'); | |
| const AmazonCognitoIdentity = require('amazon-cognito-identity-js'); | |
| let cognitoAttributeList = []; | |
| const poolData = { | |
| UserPoolId : process.env.AWS_COGNITO_USER_POOL_ID, | |
| ClientId : process.env.AWS_COGNITO_CLIENT_ID | |
| }; |
This file contains hidden or 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 AwsConfig = require('./../lib/AwsConfig'); | |
| function signUp(email, password, agent = 'none') { | |
| return new Promise((resolve) => { | |
| AwsConfig.initAWS (); | |
| AwsConfig.setCognitoAttributeList(email,agent); | |
| AwsConfig.getUserPool().signUp(email, password, AwsConfig.getCognitoAttributeList(), null, function(err, result){ | |
| if (err) { | |
| return resolve({ statusCode: 422, response: err }); | |
| } | |
| const response = { |
This file contains hidden or 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
| 'use strict'; | |
| global.fetch = require('node-fetch') | |
| require('dotenv').config(); | |
| const Cognito = require('./cognito/index'); | |
| const { verify } = require('./cognito/index'); | |
| const body = { | |
| email: "[email protected]", | |
| password: "Test123456!" | |
| }; |
This file contains hidden or 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 github.com/oxlb/GoLangPostgresHelloWorld | |
| go 1.14 | |
This file contains hidden or 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.6' | |
| services: | |
| postgres: | |
| image: postgres | |
| restart: always | |
| environment: | |
| - POSTGRES_USER=root | |
| - POSTGRES_PASSWORD=root | |
| - POSTGRES_DB=root |
This file contains hidden or 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
| CREATE TABLE students | |
| ( | |
| id bigint NOT NULL, | |
| name text COLLATE pg_catalog."default", | |
| CONSTRAINT student_pkey PRIMARY KEY (id) | |
| ); | |
| INSERT INTO students(id, name) VALUES | |
| (1, 'A'), |
This file contains hidden or 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
| package config | |
| import "fmt" | |
| const ( | |
| DBUser = "root" | |
| DBPassword = "root" | |
| DBName = "root" | |
| DBHost = "0.0.0.0" | |
| DBPort = "5432" |