Code Monkey home page Code Monkey logo

2020_express_ejs's Introduction

Express + EJS web server

This is a small web server using Express to serve file and EJS to template them.

The goal here is to provide a small sample of how to get started.

Build

  1. Install Node JS (Either LTS or current will be fine).
  2. Copy the code base down either with git or by downloading the zip.
  3. In a command line navigate to this directory.
  4. Run npm install

Runnning

  1. Run npm start
  2. open http://localhost:8080

Developing

Server

The web server is running in the server.js file. This uses Express JS to handle web requests.

This handles the data and passes it through to the view layer described below.

Changes made to server.js will requre you to stop the command line process and start it again.

View Layer

The web pages which are displayed. These take the data passed from the server and render them into html.

These are located in the views directory. They use EJS in order to render dynamic data into html.

When these are modified refresh the browser to view them.

Static files

These are the .css and .js files that are sent down to the client. They are kept in the public directory. Currently there is only a .css file in there used for basic styling of the outputted view.

More information

This is mostly raw code. More information on learning Node JS, Express JS and EJS can be found in this tutorial on YouTube https://www.youtube.com/playlist?list=PLJlrbbAG08uODIwuT3Ov0ytukd14AlBZx

2020_express_ejs's People

Contributors

kleeut avatar

Watchers

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