You will get one of these:
Uncaught (in promise) TypeError: Cannot read property 'toUpperCase' of undefined(…)
ReactCompositeComponent.js:870 Uncaught TypeError: Cannot read property 'displayName' of undefined
if you try to:
## Bare Bones | |
1. Create your droplet, adding the 1-click install dokku app and giving it at least 1GB memory which Dokku will need for deployment, then navigate to your server's IP and complete the process in the dokku form that will exist there. Also be sure you've followed the guide [here](https://gist.github.com/bradley/0c06d3f2d3c63b097ea5e27befd4beb3) to set up the various accounts youll need on your ubuntu server correctly before proceeding. | |
2. SSH into your droplet: `ssh root@droplet-ip` | |
3. Create your dokku app: `dokku apps:create app-name` | |
4. By default your app is located at myapp.mydomain.com. If you want your app to be accessible via the root domain, then just add the root domain as one of your app's domains. `dokku domains:add app-name mydomain.com`. | |
5. On your local machine, in your project’s Git repository, add your droplet as a remote: `git remote add dokku dokku@droplet-ip:app-name` | |
6. Dokku will start your node app itself by calling `nmp start` but if you want to modify that create a `Procf |
batchFindAll = (model,where,cback,size=10)-> | |
model.count({where}) | |
.then (res)=> | |
total = res | |
[0..Math.floor(total/size)].reduce (curr,num)=> | |
count = num*10 | |
curr.then => cback(where,count,size) | |
,Promise.resolve() |
Yes...it's true...redux is smart....smarter than you even know. It really does want to help you. It strives to be sane and easy to reason about. With that being said, redux gives you optimizations for free that you probably were completely unaware of.
connect
is the most important thing in redux land IMO. This is where you tie the knot between redux and your underlying
components. You usually take state and propogate it down your component hiearchy in the form of props. From there, presentational
const mapItemSchema = new mongoose.Schema({ | |
name: String, | |
location: { | |
// It's important to define type within type field, because | |
// mongoose use "type" to identify field's object type. | |
type: {type: String, default: 'Point'}, | |
// Default value is needed. Mongoose pass an empty array to | |
// array type by default, but it will fail MongoDB's pre-save | |
// validation. | |
coordinates: {type: [Number], default: [0, 0]} |
application: you-app-name-here | |
version: 1 | |
runtime: python | |
api_version: 1 | |
default_expiration: "30d" | |
handlers: | |
- url: /(.*\.(appcache|manifest)) | |
mime_type: text/cache-manifest |
Before begining, make sure your SSH keys are set so you can ssh
to your Dreamhost account.
$ ssh-copy-id -i ~/.ssh/id_rsa.pub xxxxxx@cloverdale.dreamhost.com
(you'll need xxxxxx's password here)
$ ssh xxxxxx@cloverdale.dreamhost.com
On the Dreamhost server you should have a directory for your site (e.g. adubdub.com
or ispeed.honeyimlost.com
(if not, you'll need to make one). You now need to make a git repository for that site (at the same level in the tree) and initialize a bare repo:
[ | |
{ | |
"id": "001", | |
"name": "Bulbasaur", | |
"img": "http://img.pokemondb.net/artwork/bulbasaur.jpg", | |
"type": [ | |
"Grass", | |
"Poison" | |
], | |
"stats": { |