官术网_书友最值得收藏!

Chapter 2.  Build a Basic Website Using MySQL Database

In this chapter we will look at some basic concepts of a Node.js application using a relational database, in this case Mysql.

Let's look at some differences between Object Document Mapper (ODM) from MongoDB and Object Relational Mapper (ORM) used by sequelize and Mysql. For this we will create a simple application and use the resources we have available which is sequelize, a powerful middleware for creation of models and mapping database.

We will also use another engine template called Swig and demonstrate how we can add the template engine manually.

In this chapter we will cover:

  • How to use the Swig template engine
  • Changing default routes from an express generator to the MVC approach
  • Installing Squelize-CLI
  • How to use ORM with Sequelize Models
  • Working with database migrations scripts
  • How to dealing with MySQL database relations
主站蜘蛛池模板: 新龙县| 湖州市| 原阳县| 马关县| 钦州市| 大名县| 宜州市| 霍州市| 姜堰市| 会同县| 玉林市| 义马市| 鹿泉市| 云和县| 新昌县| 曲沃县| 陕西省| 綦江县| 临漳县| 沂水县| 辉南县| 南投市| 乐都县| 获嘉县| 贵阳市| 西乌| 东兴市| 灵宝市| 皮山县| 冕宁县| 信丰县| 公安县| 肥乡县| 泸西县| 泰顺县| 寻乌县| 同德县| 正镶白旗| 通山县| 涿州市| 清新县|