GithubHelp home page GithubHelp logo

node-express-workshop-solution's Introduction

Westeros Beast Ledger ๐Ÿ‰

Problem

Welcome Maester Nodeon, you have inherited this ledger from your predecessor.

Complete the following tasks to turn this ledger into a wealth of information for all of Westeros.

Ahem, we're going to turn a little technical now.

  1. Serve all the files in the public directory on the '/' path of your app. This exposes a frontend that makes requests to the app.
  2. Create a GET /api/beasts to get all the records. The data can be found in data/beasts.json
    • Checkout the / route in your browser!
  3. Add support for query parameter species in the created endpoint. Return an array of records that match the type.
    • Checkout the Dragons and Dire wolves pages!
  4. Checkout the Register a Beast page. Create a handler for POST /api/beasts. Save this information back to data/beasts.json.

Finished? How about some additional challenges? ๐Ÿ˜

  1. Add support for saving the image file in the public/data/images directory.

    1. Send file data with the form from the frontend by adding enctype to the form.
     <form action="/api/beasts" method="post" id="register-form"  enctype="multipart/form-data">
  2. Implement a PUT /api/beasts/:id endpoint to replace the details of a beast.

  3. Implement DELETE /api/beasts/:id endpoint to delete a beast from the ledger.

Running the solution

npm i
npm start

node-express-workshop-solution's People

Contributors

chayanikaa 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.