GithubHelp home page GithubHelp logo

babis74 / basic-express-framework Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.1 MB

Ανάπτυξη βασικού Framework με Node-Express και Handlebars σαν template engine για την περαιτέρω ανάπτυξη δυναμικών Websiteς και εφαρμογών

JavaScript 79.40% Handlebars 20.60%

basic-express-framework's Introduction

home

About

Ανάπτυξη ένος βασικού Framework με Node-Express και Handlebars σαν template engine για την ανάπτυξη δυναμικών Website και εφαρμογών. Η σελίδα περιλαμβάνει 2 routes (home/about) στην δε about μπηκε δυναμικο περιεχόμενο με καθε refresh

  1. Εγκατάσταση Express

npm install --save express

  1. Δημουργία server.js

  2. Δημιουργία Routs για Home/About σελίδες

app.get('/', function(req, res){ res.type('text/plain'); res.send('Welcome to Epirus news Agency'); }); app.get('/about', function(req, res){ res.type('text/plain'); res.send('About Epirus news Agency'); }); // custom 404 page app.use(function(req, res, next){ res.type('text/plain'); res.status(404); res.send('404 - Not Found'); });

4.Εγκατάσταση Handlebars και ορισμός τους στο αρχείο server.js

var app = express(); // set up handlebars view engine var handlebars = require('express3-handlebars') .create({ defaultLayout:'main' }); app.engine('handlebars', handlebars.engine); app.set('view engine', 'handlebars');

  1. Δημιουργία Template main.handlebars

  2. Δημιουργία Template home.handlebars

  3. Δημιουργία Template about.handlebars

  4. Δημιουργία Template 404.handlebars

  5. Δημιουργία Template 500.handlebars

  6. Δημιουργία στατικού και δυναμικού περιεχομένου

Basic-Express-FrameWork

basic-express-framework's People

Contributors

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