Skip to content

Hacktinium/trove-backend

 
 

Repository files navigation

Welcome to Trove!

logo

App Overview

This API is designed to store data for the Trove front end. It is currently in development so not everything is linked up but the code has been commented to show what links up and what doesn't.

Installation and Setup Instructions

Clone down this repository. You will need node and npm installed globally on your machine.

Installation:

npm install

To Run Test Suite:

npm test

To run the app in dev mode:

npm run dev

To run the app:

npm start

Setting up your .env file to link to your database

You will need to link your database and setup the port in a .env file.

In the .env file assign your database link to the following varaible:

POSTGRES_CONNECTION_URL=

The PORT is setup to default to 3005. If you wish to change this you can use the following variable in your .env file:

PORT=

There are some setup files in the db folder. Currently no setup scripts are in place, but these are planned for the future. You need to manually setup your database but the SQL queries for these are provided in the db folder.

API Reference

ℹ️ Please allow 10-20 seconds for the deployed backend to 'wake up', as we are using a 'hobbyist' account on our deployment site.

Method Endpoint Data Type Description
GET /posts Returns all posts
GET /posts?search=[tag] string Returns all posts with the specific tag
POST /posts Creates a new post
DELETE /posts/:id number Deletes a post

App Tool Box

enter image description here

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 45.2%
  • CSS 32.9%
  • JavaScript 21.9%