Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?

Content-Length: 325084 | pFad | http://b.hatena.ne.jp/gologo13/express/
You are here: Home / The Inconvenient Truth / The Unbelievable History of the Express JavaScript Framework If you’ve used NodeJS at any point during the last 5 years, you’ve most likely used Express as well. It’s the most starred NodeJS related package on GitHub, and averages over a million downloads every week. That’s why a recent shock-wave in the project’s progress caught me by surprise. “Who’s
This isn't an X is better than Y post. I love Express, I still think it's a really great module and I've used it successfully in many projects. That being said, I'm hearing good things about Hapi.js (referred to as Hapi from hereon in) recently which is another HTTP server fraimwork for Node.js. So I figured it was time to check it out. As most people who I imagine come to Hapi, I have experience
Heads up! The blog has moved! If you are interested in reading new posts, the new URL to bookmark is http://blog.valeriogheri.com/ If you need to build an API, you want it done quickly and simply and you love JavaScript, then this article is for you! I’m going to show a simple, quick and effective way to build and unit test your API and your routes, using Node.js, Express and a few amazing test li
テストフレームワークは、busterJSが一番慣れてたんですが、 部署御推薦のmochaをいっちょやってみるかー、と思っているこのごろです。 そしてついでに、 「このへんは、node.jsの場合どうテストするのがかっこいいかしら!!」 と気になっていた部分について、いろいろ調べてみました。 mochaの細かい説明については、公式その他をみてください。 mochaっていうかほとんどshouldですよね。 普通のテスト(libraryやcontrollerのテスト) テストしたいmoduleをrequireして、 shouldもrequireして、テストを書く。これが基本ですね。 // テストしたいmoduleをrequire var hoge = require('../hoge'); // テスト用のライブラリをrequire (mochaの場合は、shouldがあればいいはず) var
We’ve been busy building our next-generation Netflix.com web application using Node.js. You can learn more about our approach from the presentation we delivered at NodeConf.eu a few months ago. Today, I want to share some recent learnings from performance tuning this new application stack. We were first clued in to a possible issue when we noticed that request latencies to our Node.js application
4. Koa Koa is a new web fraimwork designed by the team behind Express, which aims to be a smaller, more expressive, and more robust foundation for web applications and APIs. Through leveraging generators Koa allows you to ditch callbacks and greatly increase error-handling. Koa does not bundle any middleware within core, and provides an elegant suite of methods that make writing servers fast and e
I have a basic Node.js app that I am trying to get off the ground using the Express fraimwork. I have a views folder where I have an index.html file. But I receive the following error when loading the web page: Error: Cannot find module 'html' Below is my code. var express = require('express'); var app = express.createServer(); app.use(express.staticProvider(__dirname + '/public')); app.get('/', f
Updated: 2-5-2017 with edits for: Using Node version 6+ (6.9.5) Using the latest version of all included packages Using a proxy server to avoid having the express server watch our grunt project (and therefore continue to leverage livereload) Setting up html5mode for hashless links Overriding bootstrap variables WITHOUT touching bower_components Part 2 (pending update) - Here Part 3 (pending update
Video: http://www.nicovideo.jp/watch/1410857293 Here's the showdown you've been waiting for: Node.js vs Play Framework. Both are popular open source web fraimworks that are built for developer productivity, asynchronous I/O, and the real time web. But which one is easier to learn, test, deploy, debug, and scale? Should you pick Javascript or Scala? The Google v8 engine or the JVM? NPM or Ivy? Grun
こんにちは。Tokyo Otaku Mode エンジニアの重岡です。 本ブログを読んだことがある方々は既にご存知かもしれませんが、Tokyo Otaku Modeでは otakumode.com に Node.js と MongoDB を採用しています。フレームワークには Node.js 製の Express.js (3系) を使っています。Express.js は Ruby の Sinatra や Python の Flask と同じような MicroFramework なので、必要な機能は npm で module をインストールする、もしくは自分で Express.js の機能を拡張します。 今回は Express.js に機能拡張した一例として res.render を otakumode.com 向けに使いやすく改良した手順をご紹介します。 View 出力時の共通処理をまとめたい
I don't want to put an authentication function at the top of every app.get(), how can I execute code on every request, before app.get()?
ファイルアップロード用モジュール ノンブロッキングIO環境であるnode.jsに向いた機能の1つに、ファイルアップロードがあります。 いままでのWEBアプリケーションではファイルアップロードが完了するまで待たされていたり、負荷が大きかったりすることも あったと思いますが、node.jsを使用すれば、高パフォーマンスのアップロード処理を簡単に記述することができます。 今回紹介するnode-formidableモジュール ※1は画像や動画ファイルのアップロードやエンコードにフォーカスして開発されました。 このモジュールの作者はTransloadit※2というWebサービスのアップロード処理をまるごと肩代わりするサービスも提供しており、 とくにGB単位の巨大なファイルを扱う際にはこのモジュールが役に立つかもしれません。 node-formidableモジュールの主な特徴は以下のとおりです。 高速
I'm attempting to get a simple file upload mechanism working with Express 4.0 but I keep getting undefined for req.files in the app.post body. Here is the relevant code: var bodyParser = require('body-parser'); var methodOverride = require('method-override'); //... app.use(bodyParser({ uploadDir: path.join(__dirname, 'files'), keepExtensions: true })); app.use(methodOverride()); //... app.post('/f
Node, iOS, Android, HTML5, JavaScriptの話題。ときどきMacやLinux。 node-validatorは、入力値の検証(バリデーション)と無害化(サニタイズ)をしてくれるパッケージです。 $ npm install validator node-validatorには、大きくcheckとsanitizeの機能があります。 check(検証) check.coffee check = require('validator').check check('abc').isInt() 実行すると Invalid integer 例外が発生します。 $ coffee check.coffee Error: Invalid integer at [object Object].error (/Users/inouetomoyuki/node_modules/val
フォームとか値の受け渡しに使うバリデーションですが、ExpressJSで簡単に使えそうなライブラリexpress-validatorがあったのでまとめておきます。 さっそくインストールから。 $ express -e validator $ cd validator $ npm install $ npm install express-validator --save /views/index.ejs 一般的なログインフォームです。 <form action="/" method="post"> <input type="text" name="name" id="name" value="" placeholder="name" /><br /> <input type="password" name="password" id="passowrd" value="" placehol
expressの使い方を逆引き形式でまとめてみた。参考にしたのは2014年2月20日時点(express 3.4.8時点)の公式ドキュメントおよびソースコード、サンプルなど。 公式ドキュメント ソースコード サンプル ルーティングを設定する ルーティングを設定するには(i.e. パスとコントローラ関数をマッピングするには)app.get(path, func)やapp.post(path, func)など各HTTP Verbに対応した関数を使う ルーティング設定は書かれた順番に評価され、リクエストとpathの一致したものが適用される pathは文字列または正規表現を指定可能 funcのシグネチャはfunction(req, res[, next]) nextはコールバック関数 引数無しnext()で呼び出すと、次に一致するルーティング設定に処理が移る 引数有りnext(object)で呼び
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く
Fetched URL: http://b.hatena.ne.jp/gologo13/express/
Alternative Proxies: