An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| const echoPostRequest = { | |
| url: 'https://<my url>.auth0.com/oauth/token', | |
| method: 'POST', | |
| header: 'Content-Type:application/json', | |
| body: { | |
| mode: 'application/json', | |
| raw: JSON.stringify( | |
| { | |
| client_id:'<your client ID>', | |
| client_secret:'<your client secret>', |
| import { mocked } from 'ts-jest/utils'; | |
| import { Handler } from 'aws-lambda'; | |
| import { middyfy } from '@libs/lambda'; | |
| jest.mock('@libs/lambda'); | |
| describe('hello', () => { | |
| let main; | |
| let mockedMiddyfy: jest.MockedFunction<typeof middyfy>; |
| import middy from '@middy/core'; | |
| import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda'; | |
| import { formatJSONResponse } from './apiGateway'; | |
| import { AppError } from './appError'; | |
| import MiddlewareFunction = middy.MiddlewareFunction; | |
| export const apiGatewayResponseMiddleware = (options: { enableErrorLogger?: boolean } = {}) => { | |
| const after: MiddlewareFunction<APIGatewayProxyEvent, any> = async (request) => { |
| import { DynamoDB } from 'aws-sdk'; | |
| import { ref } from './intrinsic'; | |
| import cloudformationResources, { MyTable } from './resources'; | |
| export default { | |
| handler:'create.main', | |
| environment: { | |
| TABLE_NAME: ref(cloudformationResources, MyTable) | |
| }, |
| import { | |
| CloudFormationResource, | |
| CloudFormationResources, | |
| } from 'serverless/aws'; | |
| import { findKey } from 'lodash'; | |
| interface CloudFormationReference { | |
| Ref: string; | |
| } |
| import { DynamoDB } from 'aws-sdk'; | |
| export default { | |
| handler:'create.main', | |
| environment: { | |
| TABLE_NAME: { | |
| Ref: 'MyTable' | |
| } | |
| }, | |
| events: [ |
| export { default as hello } from './hello'; | |
| export { default as goodbye } from './goodbye'; |
| export default { | |
| hello: { | |
| handler: 'index.hello' | |
| }, | |
| goodbye: { | |
| handler: 'index.goodbye' | |
| } | |
| }; |
An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| #!/bin/bash | |
| # Here short description of this script | |
| # This is just a template to be used for writing new bash scripts | |
| ### | |
| # Based on Google Style Guide: https://google-styleguide.googlecode.com/svn/trunk/shell.xml | |
| # General remarks | |
| # * Executables should have no extension (strongly preferred) or a .sh extension. | |
| # * Libraries must have a .sh extension and should not be executable |