Coder Social home page Coder Social logo

contactlist-in-express's Introduction

Home Work 17.01.22

Create a node project. Add express, nodemon add the needded scripts for starting (dev, start etc.)

Create new node project. create node server express create 2 post routes (app.post('contact-us')) (app.post('reminders')) Create a public folder to hold your html files. To the public folder add index.html, contact.html, reminders.html files. in the index,html add 2 links, one to contect.html, and one for reminders.html (a href) Serve those file ith app.use(static) //express.static

In the contact.html create 3 input (name, email phone) Create a button (contact us) On button click get the values from the inputs and send them to the server. hiny $.post('contact-us') (fill the rest.)

in the contact-us route: catch this data from the req.body (hint, you need to use app.use() - app.use(express.urlencoded({ extended: true }))) wirte this data to the DB.

In the reminders.html create 1 input (reminder) Create a button (reminde-me) On button click get the value from the input and send it to the server. hiny $.post('reminders') (fill the rest.)

in the reminders route: catch this data from the req.body (hint, you need to use app.use() - app.use(express.urlencoded({ extended: true }))) wirte this data to the DB.

Bonus: (we want over it at the end of the lesson) Create a middlewere that write down each incomming request to the server in a json file (each request as a json object) Hint(app.use())

Good luck

contactlist-in-express's People

Contributors

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