Permalink
Browse files

changed whitespace indention from 4 to 2 spaces

  • Loading branch information...
1 parent bee7a9a commit d1d24a3d09b93e185a7f98e42b9ecc37e84c62f3 Tim Schindler committed Apr 27, 2012
View
@@ -13,51 +13,10 @@
## Installation:
- To just use the server do:
-
$ npm install
- If you want to create a new app on top of sayndo, create
- the app doing this:
-
- $ sh node_modules/sayndo/bin/create-app.sh
-
-
-
- Finally your app should look something like that:
-
- your app -
- |- app -
- | |- controller
- | |- model
- | |- view
- |
- |- config -
- | |- app_locals.js
- | |- config.js
- |
- |- node_modules -
- | |- sayndo
- |
- |- public -
- | |- image
- | |- javascript
- | |- stylesheet
- | |- view -
- | | - layout -
- | | |- default_layout.html
- | | |- test_layout.html
- | |
- | | - index.html
- |
- |- test
- |- package.json
- |- server.js
-
-
-
For session support the redis server is required. The redis
client for node gets installed on "npm install", but you have
to install the redis server by yourself on your mashine. Linux
@@ -71,13 +30,29 @@
## Run server:
- Start the server with default settings on 127.0.0.1:3000.
+ Start the server with default settings on 127.0.0.1:3000
+
+ $ node app.js
- $ node server.js
+ Start the server with custom settings on <host>:<port>
- Start the server with custom settings on [host]:[port].
+ $ node app.js <host> <port>
- $ node server.js [host] [port]
+
+
+## Configuration:
+
+ You have to structure your directories like this:
+
+ app -
+ |- config -
+ | |- config.js
+ | |- app_locals.js
+ |
+ |- node_modules
+
+ For detailed information see example/config/config.js.
+ It´s well commented.
@@ -90,7 +65,7 @@
var app = require('sayndo');
app.guest.GET['/'] = function(req, res) {
- res.view.render('/index.html', {msg: 'hello world'});
+ res.render('/index.html', {msg: 'hello world'});
};
@@ -369,3 +344,9 @@
concurrency 546 804 | 207 423
longest request 22.05 9.32 | 9.13 9.54
+
+
+## Questions and notices:
+
+ Send me a message on github.
+
View
@@ -7,22 +7,22 @@ var app = require('sayndo');
* Routes
*/
app.guest.GET['/'] = function(req, res) {
- // Show all cookies.
- console.log('cookie header: ' + req.headers.cookie);
+ // Show all cookies.
+ console.log('cookie header: ' + req.headers.cookie);
- // Create and update cookies. Set expiration for 10 minutes.
- res.cookie.write('test', 4321, 'path=/;', 10);
+ // Create and update cookies. Set expiration for 10 minutes.
+ res.cookie.write('test', 4321, 'path=/;', 10);
- // Read a specific cookie.
- res.cookie.read('test', function(cookie) {
- if(cookie) {
- console.log('test cookie: ' + cookie);
+ // Read a specific cookie.
+ res.cookie.read('test', function(cookie) {
+ if(cookie) {
+ console.log('test cookie: ' + cookie);
- // Remove a specific cookie.
- res.cookie.remove('test');
- }
- });
+ // Remove a specific cookie.
+ res.cookie.remove('test');
+ }
+ });
- res.render('/index.html', {local: 'hello world'});
+ res.render('/index.html', {local: 'hello world'});
};
@@ -1,19 +1,19 @@
/*
*
- * Server site app local module.
+ * App locale module.
*
*/
/*
* Module variables.
*/
var appLocals = {
- /*
- *
- */
- title: function(req, res) {
- return 'Sayndo';
- }
+ /*
+ *
+ */
+ title: function(req, res) {
+ return 'Sayndo';
+ }
};
module.exports = appLocals;
Oops, something went wrong.

0 comments on commit d1d24a3

Please sign in to comment.