Permalink
Browse files

Migrated dependencies.

  • Loading branch information...
akoenig committed May 26, 2012
1 parent 13f8363 commit 334a5d9800b87113909e0cc80494f7cdff6919bc
Showing with 32 additions and 32 deletions.
  1. +1 −2 README.md
  2. +16 −15 example/app.js
  3. +3 −3 example/package.json
  4. +5 −5 example/views/index.html
  5. +3 −3 example/views/layout.html
  6. +4 −4 package.json
View
@@ -24,9 +24,8 @@ Using lingua comes down with four simple steps:
// Express app configuration code and lingua init.
app.configure(function(){
...
- app.register(".html", require("jqtpl").express);
app.set('views', __dirname + '/views');
- app.set("view engine", "html");
+ app.set('view engine', 'ejs');
// Lingua configuration
app.use(lingua(app, {
View
@@ -12,35 +12,35 @@
* Module dependencies.
*/
-var express = require('express'),
- lingua = require('../lib/lingua');
+var express = require('express')
+ //, lingua = require('../lib/lingua')
+ , http = require('http');
-var app = module.exports = express.createServer();
+var app = express();
// Configuration
-app.configure(function(){
- app.register(".html", require("jqtpl").express);
+app.configure(function () {
+ app.set('port', process.env.PORT || 8080);
+
app.set('views', __dirname + '/views');
- app.set("view engine", "html");
+ app.set('view engine', 'ejs');
// Lingua configuration
- app.use(lingua(app, {
+ /*app.use(lingua(app, {
defaultLocale: 'de-de',
path: __dirname + '/i18n'
- }));
+ }));*/
+ app.use(express.favicon());
+ app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(__dirname + '/public'));
});
-app.configure('development', function(){
- app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
-});
-
-app.configure('production', function(){
+app.configure('development', function () {
app.use(express.errorHandler());
});
@@ -55,5 +55,6 @@ app.get('/', function(req, res) {
});
});
-app.listen(3000);
-console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);
+http.createServer(app).listen(app.get('port'), function() {
+ console.log("Express server listening on port " + app.get('port'));
+});
View
@@ -1,9 +1,9 @@
{
"name": "express-lingua-example"
- , "version": "0.0.2"
+ , "version": "0.0.3"
, "private": true
, "dependencies": {
- "express": "2.5.8"
- , "jqtpl": ">= 1.0.0"
+ "express": "3.0.0alpha4"
+ , "ejs": "0.7.x"
}
}
View
@@ -1,17 +1,17 @@
<nav>
<ul>
- <li><a href="?language=de-de">${lingua.navigation.german}</a></li>
- <li><a href="?language=en">${lingua.navigation.english}</a></li>
+ <li><a href="?language=de-de"><%= lingua.navigation.german %></a></li>
+ <li><a href="?language=en"><%= lingua.navigation.english %></a></li>
</ul>
</nav>
<article>
<header>
<hgroup>
- <h1>${lingua.index.headline}</h1>
- <h2>${lingua.index.subheadline}</h2>
+ <h1><%= lingua.index.headline %></h1>
+ <h2><%= lingua.index.subheadline %></h2>
</hgroup>
</header>
- <p>${linguac(lingua.index.person, person)}</p>
+ <p><%= linguac(lingua.index.person, person) %></p>
</article>
@@ -1,17 +1,17 @@
<!doctype html>
<html>
<head>
- <title>${lingua.title}</title>
+ <title><%= lingua.title %></title>
<link rel="stylesheet" type="text/css" href="stylesheets/screen.css" />
</head>
<body>
<div id="wrapper">
- {{html body}}
+ <%= html body %>
</div>
<footer>
- <small>&copy; 2011, <a href="https://plus.google.com/105066655811382416959/about">André König</a> - <a href="http://www.opensource.org/licenses/mit-license.php">${lingua.index.licence}</a></small>
+ <small>&copy; 2011, <a href="https://plus.google.com/105066655811382416959/about">André König</a> - <a href="http://www.opensource.org/licenses/mit-license.php"><%= lingua.index.licence %></a></small>
</footer>
</body>
</html>
View
@@ -6,15 +6,15 @@
"type": "git",
"url": "git://github.com/akoenig/express-lingua.git"
},
- "author": "André König <andre.koenig@gmail.com> (http://lochkartenstanzer.de)",
+ "author": "André König <andre.koenig@gmail.com> (http://profile.lochkartenstanzer.de)",
"main": "./lib/lingua.js",
"directories": {
"lib": "lib"
},
"dependencies": {
- "cookies": ">= 0.1.6"
+ "cookies": "0.3.x"
},
"engines": {
- "node": ">=0.4.0"
+ "node": ">= 0.6.x"
}
-}
+}

0 comments on commit 334a5d9

Please sign in to comment.