var body = "hello world";
response.setHeader("Content-Length", body.length);
response.setHeader("Content-Type", "text/plain");
response.setHeader("Set-Cookie", "type=ninja");
response.status(200);
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
// To send sms message with Twilio SMS API in Node.js. | |
/*----------------------Sample codes----------------------*/ | |
// .env | |
// TWILIO_ACCOUNT_SID='ACde4b5sample3cc1fb166ef26bd83e8' | |
// TWILIO_AUTH_TOKEN='4f631903940sample06869e988' | |
// TWILIO_NUMBER='+162822XXXXXX' | |
// init twilio |
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
// To send email with AWS Simple Email Service(SES) API in Node.js. | |
/*----------------------Sample codes----------------------*/ | |
// .env | |
// AWS_KEY='AKAMTCsample2FUUQ' | |
// AWS_SECRET='4RsVEfTBJudFA9/pyFnjPvFsampleCbfq69bRV' | |
// AWS_IAM_NAME='IAM_NAME' | |
// AWS_SES_SENDER='[email protected]' |
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 strip API to charge the card | |
var stripe = require('stripe')(process.env.STRIPE_API_SECRET) | |
// ... in models.js | |
stripe.charges.create({ | |
amount: 50 * 100, // 50.00 dollars | |
currency: "usd", | |
source: dataObj.stripeToken.id, | |
description: `payment verification for ${dataObj.userData._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
// change es6 to all-browser-friendly js | |
var gulp = require('gulp'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var plumber = require('gulp-plumber'); | |
var babel = require('gulp-babel'); | |
gulp.task('js', ['clean:js'], function() { | |
return gulp.src('dev/**/*.js') // input files | |
.pipe(sourcemaps.init()) // help to show where error is init |
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
// need to be updated |
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
// need to be updated |
##Tech. skills:
- 1. webpack
- 2. es6 native Promise
- 3. Redux middleware
- 4. HOC in React
- 5. scribbletune
- 6. EclairJS - js-spark
##Project:
https://yeah-server.herokuapp.com
request | endpoint | body | response |
---|
#1. install eb, tutorial
$ brew install awsebcli
$ eb --version
#2. start to deploy
$ eb init
$ eb create
OlderNewer