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
provider "aws" { | |
access_key = "${var.access_key}" | |
secret_key = "${var.secret_key}" | |
region = "${var.region}" | |
} | |
resource "aws_instance" "example" { | |
ami = "${lookup(var.amis, var.region)}" | |
instance_type = "t2.micro" |
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
variable "access_key" {} | |
variable "secret_key" {} | |
variable "region" { | |
default = "ap-northeast-2" | |
} | |
variable "key_name" {} | |
variable "key_path" {} | |
provider "aws" { | |
access_key = "${var.access_key}" |
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
variable "access_key" {} | |
variable "secret_key" {} | |
variable "region" { | |
default = "ap-northeast-2" | |
} | |
variable "key_name" {} | |
variable "key_path" {} | |
provider "aws" { | |
access_key = "${var.access_key}" |
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'; | |
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const app = express(); | |
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({extended: false})); | |
app.use((req, res, next) => { | |
console.log('Got request, %s %s', req.method, req.url, req.ip, req.headers); |
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'; | |
const http = require('http'); | |
const request = require('request'); | |
const server = http.createServer((req, res) => { | |
request({ | |
method: 'GET', | |
url: 'http://www.naver.com' | |
}).on('error', (e) => { |
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'; | |
const http = require('http'); | |
const url = require('url'); | |
const request = require('request'); | |
const server = http.createServer((req, res) => { | |
const destUrl = req.url.slice(1); | |
if (!destUrl) { |
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'; | |
const request = require('request'); | |
const AWS = require('aws-sdk'); | |
const s3 = new AWS.S3({apiVersion: '2006-03-01', region: 'ap-northeast-2'}); | |
// fetch binary from `url` and upload to s3 using `key` as object key | |
const store = (url, key) => { | |
return new Promise((resolve, reject) => { |
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'; | |
const request = require('request'); | |
const AWS = require('aws-sdk'); | |
const s3 = new AWS.S3({apiVersion: '2006-03-01', region: 'ap-northeast-2'}); | |
// fetch binary from `url` and upload to s3 using `key` as object key | |
const store = (url, key) => { | |
return new Promise((resolve, reject) => { |
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'; | |
const request = require('request'); | |
const AWS = require('aws-sdk'); | |
const s3 = new AWS.S3({apiVersion: '2006-03-01', region: 'ap-northeast-2'}); | |
// fetch binary from `url` and upload to s3 using `key` as object key | |
const store = (url, key) => { | |
return new Promise((resolve, reject) => { |
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'; | |
const fs = require('fs'); | |
const request = require('request'); | |
const AWS = require('aws-sdk'); | |
const s3 = new AWS.S3({apiVersion: '2006-03-01', region: 'ap-northeast-2'}); | |
// fetch binary from `url` and upload to s3 using `key` as object key | |
const store = (path, key) => { |