- Instal Deno. It's a secure runtime for JavaScript and TypeScript.
- Generate a personal access token for GitHub. And save it to
~/.github-oauth
. You can use the following command to save it:echo generated_github_personal_access_token_goes_here > ~/.github-oauth
option_settings: | |
- option_name: ROOT_URL | |
value: http://app-name.elasticbeanstalk.com | |
- option_name: MONGO_URL | |
value: mongodb://user:pass@some-mongo.com:3001/app-name | |
- namespace: aws:elasticbeanstalk:container:nodejs | |
option_name: ProxyServer |
var models = { | |
'user': User, | |
'todo': Todo | |
}; | |
server.get( '/:model', function(req, res, next) { | |
models[req.params.model] | |
.findAll({}) // .findAll({ include: [ req.body.include ] }) | |
.then(results => { res.send(200, results);}) /// need HTTP status codes | |
.catch(err { res.send(400, results);}); |
var models = { | |
'user': User, | |
'todo': Todo | |
}; | |
server.get( '/:model', function(req, res, next) { | |
models[req.params.model] | |
.findAll({}) // .findAll({ include: [ req.body.include ] }) | |
.then(results => { res.send(200, results);}) /// need HTTP status codes | |
.catch(err { res.send(400, results);}); |
Changes to Meteor packages (OAuth & Google) to support Meteor web app deployed under multiple domains (for branding purpose, for example).
Only changes to Google and the core OAuth packages are included here. Other OAuth packages, such as Facebook can be amended in a similar way.
The solution does not include sharing the login state across the domains. If that's what you need, there's another suggested solution for that on the net.
Note: The files attached don't include complete source code from the packages but only changed functions.
import _ from 'underscore'; | |
import Promise from 'bluebird'; | |
import { | |
GraphQLInt, | |
GraphQLList, | |
GraphQLObjectType, | |
GraphQLSchema, | |
GraphQLString | |
} from 'graphql'; | |
import { |
From Meteor's documentation:
In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.
This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.
Sometimes we need to run async code in Meteor.methods
.
For this we create a Future
to block until the async code has finished.
#!/bin/bash | |
aws --version | |
aws configure set default.region us-west-2 | |
aws configure set default.output json | |
echo "preparing task definition" | |
aws ecs describe-task-definition --task-definition applications | ./jq --arg x $CIRCLE_SHA1 ' .taskDefinition | |
| del(.status) | |
| del(.taskDefinitionArn) |
option_settings: | |
- option_name: AWS_SECRET_KEY | |
value: ------------------------------------------- | |
- option_name: AWS_ACCESS_KEY_ID | |
value: ------------------------------ | |
- option_name: PORT | |
value: 8081 |
# Copied from http://www.codeship.io/documentation/continuous-deployment/deployment-to-elastic-beanstalk/ | |
#!/bin/sh | |
export APP_VERSION=`git rev-parse --short HEAD` | |
pip install awscli | |
# clean build artifacts and create the application archive (also ignore any files named .git* in any folder) | |
git clean -fd | |
# precompile assets, ... |