Code Monkey home page Code Monkey logo

music-library's Introduction

CRUD on a musical database

This repository sets up a backend connection to a MySQL database using the following template in an .env file

DB_USER= database username
DB_PASSWORD= password
DB_NAME= music_library
DB_HOST= localhost
DB_PORT= 3307

Once you have populated the .env file, you can use the command npm start

This will start an express server locally which you can use GET POST PATCH and DELETE HTTP methods to manipulate the data at the following endpoints:

Endpoint Method Function
/artist GET retrieves all artists
/artist/:artistID GET retrieves one artist by specific ID
/artist POST creates a new artist from request body
/artist/:artistID PATCH alters specific artist data from request body
/artist/:artistID DELETE deletes artist specified
/albums GET retrieves all albums
/artist/:artistID/album GET retrieves all albums by one artist
/artist/:artistID/album/:albumID GET retrieves one album by ID, by artist
/artist/:artistID/album POST creates a new album linked to the artist, using data from request body
/artist/:artistID/album/:albumID PATCH alters specific album by artist, using request body data
/artist/:artistID/album/:albumID DELETE deletes specific album

Data schema

This is how the request body should be set out when using the API.

Artist JSON is set out below:

{
    "name": "The Beatles",
    "Genre": "Classic Rock"
}

Album JSON is like the following:

{
    "name": "Abbey Road",
    "year": "1969"
}

music-library's People

Contributors

nathanmayall avatar

Watchers

 avatar

Forkers

thepunkyone

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.