Giter Site home page Giter Site logo

janluksoft / node_express_js_controllers Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 143 KB

Node Express JS: uses GET, POST method. File division into router, controllers, views;

License: MIT License

JavaScript 25.33% CSS 32.96% Handlebars 41.70%
controllers expressjs get-post-method handlebars hbs javascript node nodejs routing

node_express_js_controllers's Introduction

The Node Express JS app with the controller structure

This web application demonstrates the use of GET and POST methods by making browser requests to a node server and vice versa.

This application has:

  • Express framework;
  • JavaScript language;
  • Built-in middleware: express.static;
  • Partials (layouts) of header, footer;
  • Hbs template engine;
  • Helpers: [#each], [#if];
  • Multi-page portal - switching from the menu;
  • Request handling: Get, Post
  • Division into file structure:
    • Server;
    • App_hbs;
    • Routers;
    • Controller applications (POST method);
    • Controller pages (GET method);
    • Data class;

.

Application operation

This application has a good file structure for separating tasks in the back-end: app, router, controllers. Many websites are used in large web-apps. Handling multiple pages in one file - causes confusion and lack of order. Therefore, tasks are divided into different folders and files. GET commands are handled by PagesController.js, POST by ApplicationsController.js and separation is handled by: \routes\index.js.

Pages are switched via the Get method. The router finds the correct EndPoint and based on it, renders the page to the browser. On Log page - the button sends login data to the Node server using the POST method. The server analyzes these login details. If the data is correct - the Node will return a table for display.

node_express_js_controllers's People

Contributors

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