node js koa

來源:互聯網
上載者:User

標籤:項目   學習   post   文檔   命令   刪除   als   檢查   安裝   

### nodejs項目配置終端命令1. 檢查本地 nodejs 版本`$node -v` 如果版本低就升級2. 安裝 n 升級命令 `$npm install -g n`3. 安裝穩定版`$n stable` 最新版 v7.x.x4. 安裝 koa 產生器 `$npm install -g koa-generator`5. `cd /test/` 目錄下面使用最新版 koa2 建立項目 `$koa2 testKoa`6. 跳轉到package.json所在的目錄裡面,安裝所有引用包 `$npm install`7. 安裝 ejs html模板引擎 `$npm i -S ejs`8. chrome調試工具`$npm install -g node-inspector`9. 如果上面的安裝不成功,安裝這個:https://github.com/Jam3/devtool10. Sublime 建議使用vscode 開發工具,調試方便 [](https://code.visualstudio.com/Download)11. router.get(‘/:id/:userid‘, async function (ctx, next) url傳遞參數 http://127.0.0.1:3000/classname/1/212. orm 架構:Sequelize api學習參考:中文地址1:http://itbilu.com/nodejs/npm/VkYIaRPz-.html#api-sequelize中文地址2:http://itbilu.com/nodejs/npm/VkYIaRPz-.html#api-sequelize英文地址:http://docs.sequelizejs.com/en/latest/api/model/  [Sequelize和MySQL對照]地址:http://www.phperz.com/article/15/1113/169037.html13. [es6學習地址](http://es6.ruanyifeng.com/)14. 修改sequelizejs時區格式轉換,檔案“data-types.js” 注釋掉如下資訊,去掉時區格式轉換     // if (moment.tz.zone(options.timezone)) {    //   value = moment.tz(value, options.timezone).toDate();    // } else {    //   value = new Date(value + ‘ ‘ + options.timezone);    // }        ``` 15. restful api 規範  GET /collection:返回資來源物件的列表(數組)      查詢 GET /collection/resource:返回單個資來源物件     查詢 POST /collection:返回新產生的資來源物件          建立 PUT /collection/resource:返回完整的資來源物件    更新 PATCH /collection/resource:返回完整的資來源物件  批量 DELETE /collection/resource:返回一個空文檔    刪除   

node js koa

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.