Giter VIP home page Giter VIP logo

quiz_1's People

Contributors

xxue avatar

Watchers

 avatar  avatar

quiz_1's Issues

Marking - Feb 10th

Good job! Most of the functionality and layout elements are there. Right now you're sitting at 80% - if you can make the dashboard work on mobile then it'll be ๐Ÿ’ฏ% ๐Ÿ˜

I really like how you used an array for the "trending" tweets instead of hardcoding them into the view. This decouples the data from the display, which would allow you to calculate the trending topics in a different way without changing your layout code.

You're calculating a date in the get function, but ideally you would calculate the date that each was posted and store it in the cookie alongside the username and text.

Additionally, the way you're passing req.cookies to the view means that you may get some unexpected data. Cookies are managed on a domain basis, meaning that over time you'll build up a bunch of different cookies for localhost for the various applications you're working on. Iterating over req.cookies will inadvertently display data that aren't actually tweets!

A better approach would be to create a tweets key:

// storing a tweet
let tweet = req.body;
res.cookie('tweets', tweet, { maxAge: 2592000000 })

// retrieving all the tweets
let cookies = request.cookies.tweets

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.