Giter Site home page Giter Site logo

sequelize-101's Introduction

Sequelize 101

Code for my Sequelize 101 talk.

Hello, and welcome! This tutorial covers the basics of CRUD operations and simple examples using the Node ORM Sequelize. We will use Express.js to build out an API, but the focus here is Sequelize. I will assume you have PostgreSQL installed on your machine, and that you're using Node version ^8.10

  • Built with Node.js and Express

Express Router and Routes

Route HTTP Verb Description
/api/users GET Get list of users
/api/users POST Creates a new user
/api/users/:id GET Get a single user
/api/users/:id DELETE Deletes a user
/api/users/me GET Get my info

Getting Started

Prerequisites

Usage

Run basic examples

SYNC Data Base

  1. Run npm install to install server dependencies.
  2. Run npm run dev to start the development server and sync db
  3. After the terminal shows: info: Express server listening on 3000, in development mode stop the demon

Run Examples

# Move to example folder
$ cd examples

# Fill the database with the sample data
$ node seed.js

# Run any of the examples
node 1.js

node sum.js

Workshop

If you want to do the workshop, in the repo wiki you can find it.

Developing

  1. Run npm install to install server dependencies.
  2. Run npm run dev to start the development server.
  3. Open a new tab of the terminal and run: node example/seed.js
  4. Open browser http://localhost:3000/api/users.

Contributors

Cristian Moreno - FullStack Javascript Developer

sequelize-101's People

Contributors

khriztianmoreno avatar renovate-bot avatar renovate[bot] avatar dependabot[bot] avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.