Giter VIP home page Giter VIP logo

workshop-2's Introduction

Node Girls Basic CMS Example

Build and Test

Build & Test

Command Description
npm install Installs all the dependencies in the package.json
npm start Starts the server
npm run start:dev Starts the server and watches for changes. Restarts on change
npm run lint Lints JavaScript code making sure project remains consistent
npm run open Mac only. Opens localhost:8000 in your default browser
------------------------------- -----------------------------------------------------------------------

Hints and tips

Node.js documentation

  • There are lots of useful Node modules and methods that will help you build your server. fs is one, fs.writeFile and fs.readFile will be useful as well.
  • Look at the Node.js documentation for a list of all the different modules, methods and how to use them. Of course, ask a mentor if you need pointing in the right direction!

Use the tests!

  • Take a look at the tests, and how they are structured. It may give you a hint on what your project should do.

Refreshing your page

  • You might want to refresh the page automatically when you submit a blog post. One way to do it is to send back to your client a 302 status code. A 302 status code basically says "redirect to whatever it says in the HTTP Location Header".

  • You might find the response.writeHead() method useful - read about it here.

  • Find out more about status codes here. By the way, "status codes" and "response codes" mean the same thing :)

Querystring

  • The blog text box is a form field. The server will receive the form contents as a querystring. There is a core Node module called querystring that will help you cleanly extract the contents of your blog post. Find out about the core querystring module here.

Http methods

Stuck? Ask a mentor!

Tools and Libraries We Recommend Used:

eslint - Lint tool


EditorConfig - Unifying the coding style for different Text Editors


node-static - Simple Node Routing Module


pre-commit - Learn about pre-commit hooks


istantbul - Istanbul is a JavaScript code coverage tool


workshop-2's People

Contributors

anniva avatar claireinez avatar heron2014 avatar minaorangina avatar msmichellegar avatar natalialkb avatar rachblondon 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.