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
{ | |
"name": "react_ts", | |
"version": "0.1.0", | |
"private": true, | |
"dependencies": { | |
"@testing-library/jest-dom": "^5.11.4", | |
"@testing-library/react": "^11.1.0", | |
"@testing-library/user-event": "^12.1.10", | |
"@types/jest": "^26.0.15", | |
"@types/node": "^12.0.0", |
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 type { APIGatewayProxyEvent, APIGatewayProxyResult, Handler } from "aws-lambda" | |
import type { FromSchema } from "json-schema-to-ts"; | |
type ValidatedAPIGatewayProxyEvent<S> = Omit<APIGatewayProxyEvent, 'body'> & { body: FromSchema<S> } | |
export type ValidatedEventAPIGatewayProxyEvent<S> = Handler<ValidatedAPIGatewayProxyEvent<S>, APIGatewayProxyResult> | |
export const formatJSONResponse = (response: Record<string, unknown>) => { | |
return { | |
statusCode: 200, | |
headers: { |
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-lambda'); | |
// typeDefs | |
const typeDefs = gql` | |
type Query { | |
hello: String | |
} | |
`; | |
const resolvers = { |
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 serverless = require('serverless-http'); | |
const express = require('express'); | |
const indexRouter = require('./routes/index'); | |
const usersRouter = require('./routes/users'); | |
const app = express(); | |
app.use('/', indexRouter); | |
app.use('/users',usersRouter); | |
module.exports = app; |
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
'use strict'; | |
const MongoClient = require('mongodb').MongoClient; | |
const Config = require('../config.js'); | |
const CFG = Config.getConfig(); | |
//console.log( CFG.MONGODB_URL ); | |
//console.log( CFG.MONGODB_DB_NAME ); | |
const URI = CFG.MONGODB_URL + "?retryWrites=true&w=majority"; | |
const DbName = CFG.MONGODB_DB_NAME; | |
module.exports.getClient = async () => { | |
// console.log("IS_OFFLINE= ", process.env.IS_OFFLINE); |
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 serverless = require('serverless-http'); | |
const express = require('express'); | |
const indexRouter = require('./routes/index'); | |
const usersRouter = require('./routes/users'); | |
const app = express(); | |
app.use('/', indexRouter); | |
app.use('/users',usersRouter); | |
//module.exports = app; |
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
/* XLS templete, read */ | |
import React from 'react' | |
const ExcelJS = require('exceljs'); | |
import axios from 'axios' | |
interface IProps { | |
history:string[], | |
} | |
// | |
class Test extends React.Component<IProps> { |
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
/* jsPdf , japan lang sample */ | |
import React from 'react' | |
const ExcelJS = require('exceljs'); | |
interface IProps { | |
history:string[], | |
} | |
// | |
class Test extends React.Component<IProps> { | |
constructor(props: any) { |
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
service: service2 | |
custom: | |
dynamodb: | |
stages: | |
- dev | |
start: | |
port: 8000 | |
inMemory: true | |
migrate: true |
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
service: service1 | |
#frameworkVersion: '2' | |
provider: | |
name: aws | |
runtime: nodejs12.x | |
region: ap-northeast-1 | |
stage: dev |