Skip to content

ikito/Express-typeorm-javascript-api-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express api example using TypeORM with JavaScript

  1. Clone repository
  2. Rename ormconfig.template.json to ormconfig.json and fill with your PostgreSQL database info. Something like:
{
    "type": "postgres",
    "host": "localhost",
    "port": 5432,
    "username": "postgres",
    "password": "postgres",
    "database": "test",
    "entities": ["src/entity/*.js"],
    "logging": true,
    "synchronize": true
}
  1. I'm using PostgreSQL, if you want to use another DB just change it and replace package.
  2. Run npm i
  3. Run node app.js to run simple example
  4. Point your browser to http://localhost:3000 to test
  5. http://localhost:3000/filldb to insert data into DB
  6. http://localhost:3000/api/categories to list categories

About

Express api example using TypeORM with JavaScript

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •