このレポジトリ
- 使用目的:ドットインストールの「Express.js」の学習履歴を残す
- 参考:https://dotinstall.com/lessons/basic_expressjs
- 問題管理:Githubのissue
- ブランチ:masterのみ
Expressとは
- 概要:Node.jsのWebアプリケーションフレームワーク
- 参考:expressjs.comやexampleのサンプルコード
- 知識:node.js
- 環境:local開発環境と作業用ディレクトリ
ドットインストール
このレポジトリ
Expressとは
問題:express.loggerを使おうとすると、下記のエラーが表示される
Error: Most middleware (like logger) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.
at Function.get (/Users/mikaurakawa/Desktop/Node_Projects/BasicofExpressjs1/myapp/node_modules/express/lib/express.js:112:13)
at Object.<anonymous> (/Users/mikaurakawa/Desktop/Node_Projects/BasicofExpressjs1/myapp/app.js:13:17)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
問題:expressのプロジェクト作成後に「node app」をしてもhttpサーバーが起動しない
原因:実行する場所が以前のバージョンと変わったよう
対処方法:「node bin/www」を実行
参考:https://qiita.com/_daisuke/items/66ddf21e79bab8515ae5
問題:サーバーを起動すると、下記のエラーが表示される
Error: Most middleware (like methodOverride) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.
at Function.get (/Users/mikaurakawa/Desktop/Node_Projects/BasicofExpressjs1/blog/node_modules/express/lib/express.js:112:13)
at Object.<anonymous> (/Users/mikaurakawa/Desktop/Node_Projects/BasicofExpressjs1/blog/app.js:19:17)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
問題:updateをタップするとCannot POST /posts/0
が表示され、更新ができない
問題:送信したフォームの内容が、「/create」で送信されない。下記のように表示される
Cannot POST /create
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.