Skip to content

smetca/sam-wise-news

Repository files navigation

sam-wise-news

This is an api that hosts a small database of news articles, with users and comments.

API Main Page

Installation

1. Clone the repo

git clone https://github.com/smetca/sam-wise-news.git

2. Install the dependencies

npm install

3. Seeding the database

npm run setup-db
npm run seed

4. Create your knexfile

Create a file called knexfile.js

const { DB_URL } = process.env;

const ENV = process.env.NODE_ENV || 'development';

const baseConfig = {
  client: 'pg',
  migrations: {
    directory: './db/migrations'
  },
  seeds: {
    directory: './db/seeds'
  }
};

const customConfig = {
  production: {
    connection: `${DB_URL}?ssl=true`
  },
  development: {
    connection: {
      database: 'nc_news',
      //username
      //password
    }
  },
  test: {
    connection: {
      database: 'nc_news_test',
      //username
      //password
    }
  }
};

module.exports = { ...customConfig[ENV], ...baseConfig };

5. Run tests

npm test

Requirements

Node: version 10 and up,

Postgres: version 10.10

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published