-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
93 lines (62 loc) · 2.07 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
-----------------------------------------------
Hyde Park. Here folks shout from the corner
-----------------------------------------------
Pre-requisites:
- Install node
http://nodejs.org/#download
(or if you want to track versions)
http://tjholowaychuk.com/post/524593054/node-version-manager-preview
- Install npm
https://github.com/isaacs/npm
- Install NPM modules
% npm install connect
% npm install express
% npm install expresso
% npm install mongodb
% npm install mustache
% npm install request
% npm install socket.io
% npm install tweetstream
% npm install yql
To run the node server:
% NODE_ENV=development node app.js
(or set NODE_ENV).
-----------------------------------------------
Notes
-----------------------------------------------
- Since we use mustache on client and server now, we change the delim so the server doesn't render the client comments.
E.g.
{{=<% %>=}}
<div id="{{id}}">
- To run for production we need to bundle everything together. To do this we need to:
a) make sure all dependencies are in package.json
b) run "% npm bundle" to package all of the npm files locally into "node_modules"
c) Make sure that the app has: require.paths.unshift('./node_modules');
- Some helpful production commands and initial setup
# install the command line utility
sudo gem install vmc
# point it to the live server (instead of a b27.me loopback to localhost)
vmc target api.vcloudlabs.com
# login to the system with your temp password
vmc login
# change your password
vmc passwd
# check our the env
vmc info
# create a mongodb service
vmc create-service mongodb sddb
# see it done
vmc services
# push a directory with an app in it (but don't start it yet)
vmc push setdirection --no-start
# bind the app to the mongodb service
vmc bind-service sddb setdirection
# start the app
vmc start setdirection
# checkout any error logs
vmc crashes
vmc crashlogs setdirection
# after files have been updated, send them up
vmc update setdirection
# watch the stats
vmc stats setdirection