Skip to content

Storefront API built using Typescript, Node JS, Express, PostgreSQL & Jasmine as a testing framework

Notifications You must be signed in to change notification settings

ahmedanwar1/Storefront_Backend_Udacity

Repository files navigation

first install dependences

npm install 

script

npm run start => to start the server. "nodemon ./src/index.ts",
npm run build => to compile TS to JS. "npx tsc",
npm run test:db => to compile and run tests. "npm run build && npm run jasmine",

env

POSTGRES_HOST=127.0.0.1
POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=123456789
NODE_ENV=dev
POSTGRES_DB_TEST=postgres_test
SALT_ROUNDS=10
PASSWORD_APPENDED_STRING=skij45dfas512
TOKEN_SECRET=iltuyasd0tjq8a1rsdfg81gf

Database setup

  • connect to default database server psql -U postgres
  • create database user CREATE USER postgres WITH PASSWORD '123456789';
  • create dev and test database
    • CREATE DATABASE postgres;
    • CREATE DATABASE postgres_test;
  • connect to dev and test database and grant privileges
    • \c postgres
      • GRANT ALL PRIVILEGES ON DATABASE postgres TO postgres;
    • \c postgres_test
      • GRANT ALL PRIVILEGES ON DATABASE postgres_test TO postgres;

Runniing ports

  • node server on port 3000
  • database server on port 5432

endpoint

About

Storefront API built using Typescript, Node JS, Express, PostgreSQL & Jasmine as a testing framework

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published