Giter Club home page Giter Club logo

be-news-project's Introduction

Northcoders News API

Background

We will be building an API for the purpose of accessing application data programmatically. The intention here is to mimic the building of a real world backend service (such as reddit) which should provide this information to the front end architecture.

The database will be PSQL, and you will interact with it using node-postgres.

Configuration

Access to test and development databases

Two databases are included: test and development To connect to these the environment variable PGDATABASE needs to be configured within the code files prior to running the code. Or the environment variable NODE_ENV needs to be configured when launching the code

The PGDATABASE configuration is available through .env files which are not included in the project and need to be created.

----------------
.env-development
----------------
PGDATABASE=nc_news;
---------
.env-test
---------
PGDATABASE=nc_news_test;

Creating and populating test and development databases

The (empty) databases are created from scratch by running the npm script as follows: 'npm run setup-dbs' (see package.json scripts section)

The test database is populated either manually or as part of the jest testing process

-------------
Test database - manual
-------------
    NODE_DEV='test' npm run seed
-------------
Test database - jest testing
-------------
    npm test

Launching the API server

    npm start

be-news-project's People

Contributors

good4something-6 avatar anthonymedina avatar nc-paul-rogerson avatar daviidbartlett avatar p-copley avatar dav3rid avatar anatdean avatar sssam-c avatar alexander-cox avatar tomosim avatar isabelmaccabee avatar douglashellowell avatar liam310 avatar rogersop avatar antariess avatar bainesface avatar nicola-20 avatar two-triangles avatar

Watchers

 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.