Skip to content

0xRace/ParksApp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

117 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parkz App README

Project Description

Our website will help anyone who is traveling to National Parks in the US and is looking to view or leave reviews for various places and attractions

Target Browsers

This website has been developed for modern desktop and mobile web clients. It should be compatible with chromium based browsers, Safari, or Internet Explorer.

Link

https://group2-project377.herokuapp.com/

Developer Manual

Installation and Usage

To use this website, fork the code to a local repository and install dependancies using: npm install after Node.js has been installed
Start the server using: npm start
Access the site by navigating to localhost:3000

Endpoint Doc


Below are details of the API contained within this piece of labwork.


REST API example using Sequelize

Method Action
GET Retrieves resources
POST Creates resources
PUT Changes and/or replaces resources or collections
DELETE Deletes resources

Parks

Get list of Parks

Request

GET /api/race

curl http://localhost:3000/api/race

Response

{
"parks": [
    {
        "park_id": 1,
        "park_name": "Assateague Island",
        "trails": "none",
        "park_lat": 37.901984,
        "park_long": 75.3526373
    },
    {
        "park_id": 2,
        "park_name": "National Mall",
        "trails": "none",
        "park_lat": 38.887161,
        "park_long": 77.037331
    },
    {
        "park_id": 3,
        "park_name": "Grand Canyon",
        "trails": null,
        "park_lat": 36.056595,
        "park_long": 112.125092
    }
]

}

Update park information

Request

PUT /api/race/

curl -d "park_id=4&park_name=Example1&trails=trail&park_lat=0&park_long=1" -X PUT http://localhost:3000/api/race/

Response

Successfully updated

Reviews

Get list of Reviews

Request

GET /api/race/reviews

curl http://localhost:3000/api/race/reviews

Response

{
"reviews": [
    {
        "review_id": 1,
        "park_id": 1,
        "title": "Great trails",
        "author": "Race",
        "description": "super fun "
    },
    {
        "review_id": 2,
        "park_id": 2,
        "title": "Great trails",
        "author": "Race2",
        "description": "super fun "
    }
]

}

Get Reviews of a Park

Request

GET /api/race/reviews/:park_id

curl http://localhost:3000/api/race/reviews/1

Response

[ { "review_id": 1, "park_id": 1, "title": "Great trails", "author": "Race", "description": "super fun " } ]

Create a new Review

Request

POST /api/race/reviews

curl -d "park_id=1&title=Great Trails&author=Race&description=Trails were fun" -X POST http://localhost:3000/api/race/reviews

Response

[ { "review_id": 1, "park_id": 1, "title": "Great trails", "author": "Race", "description": "Trails were fun" } ]

Delete a Review

Request

DELETE /api/race/reviews:id

curl -X DELETE http://localhost:3000/api/race/reviews/1

Response

Successfully deleted

About

Parks Application from 377

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 68.7%
  • HTML 19.2%
  • CSS 12.1%