<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://dokuwiki.webmastermsk.ru/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://dokuwiki.webmastermsk.ru/feed.php">
        <title> nodejs:express</title>
        <description></description>
        <link>https://dokuwiki.webmastermsk.ru/</link>
        <image rdf:resource="https://dokuwiki.webmastermsk.ru/lib/tpl/dokuwiki/images/favicon.ico" />
       <dc:date>2026-08-12T13:12:51+0000</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:modeli&amp;rev=1673515089&amp;do=diff"/>
                <rdf:li rdf:resource="https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:obrabotka_formy&amp;rev=1673515089&amp;do=diff"/>
                <rdf:li rdf:resource="https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:registracija_routov&amp;rev=1673515089&amp;do=diff"/>
                <rdf:li rdf:resource="https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:rendering_dannyx_v_shablon&amp;rev=1673515089&amp;do=diff"/>
                <rdf:li rdf:resource="https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:routy_s_prefiksami&amp;rev=1673515089&amp;do=diff"/>
                <rdf:li rdf:resource="https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:server_s_html_stranicami&amp;rev=1673515089&amp;do=diff"/>
                <rdf:li rdf:resource="https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:sozdanie_servera&amp;rev=1673515089&amp;do=diff"/>
                <rdf:li rdf:resource="https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:ustanovka&amp;rev=1673515089&amp;do=diff"/>
                <rdf:li rdf:resource="https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:vyvod_spiskov_v_shablone&amp;rev=1673515089&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://dokuwiki.webmastermsk.ru/lib/tpl/dokuwiki/images/favicon.ico">
        <title></title>
        <link>https://dokuwiki.webmastermsk.ru/</link>
        <url>https://dokuwiki.webmastermsk.ru/lib/tpl/dokuwiki/images/favicon.ico</url>
    </image>
    <item rdf:about="https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:modeli&amp;rev=1673515089&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-01-12T09:18:09+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>nodejs:express:modeli</title>
        <link>https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:modeli&amp;rev=1673515089&amp;do=diff</link>
        <description>модели

models/course.js


const uuid  = require('uuid/v4'); //подключаем модуль для создания уникальных идентификаторов, 4-ой версии
const fs = require('fs');// модуль для взаимодействия с файловой системой
const path =  require('path');//модуль для генерации путей к файлам

/**
 * Добавить запись в файл , данные из формы на странице add
 */
class Course{
    /**
     * Инициализация полей формы
     * @param title загловок
     * @param price цена
     * @param img url картиеки
     */
    con…</description>
    </item>
    <item rdf:about="https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:obrabotka_formy&amp;rev=1673515089&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-01-12T09:18:09+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>nodejs:express:obrabotka_formy</title>
        <link>https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:obrabotka_formy&amp;rev=1673515089&amp;do=diff</link>
        <description>Обработка формы


&lt;h1&gt;Добавить курс&lt;/h1&gt;

&lt;div class=&quot;row&quot;&gt;
    &lt;form class=&quot;col s12&quot; action=&quot;/add&quot; method=&quot;post&quot;&gt;
        &lt;div class=&quot;row&quot;&gt;
            &lt;div class=&quot;input-field col s6&quot;&gt;
                &lt;input  id=&quot;title&quot; type=&quot;text&quot; name=&quot;title&quot; class=&quot;validate&quot; required&gt;
                &lt;label for=&quot;title&quot;&gt;Название курсв&lt;/label&gt;
                &lt;span class=&quot;helper-text&quot; data-error=&quot;Введите название&quot; data-success=&quot;right&quot;&gt;&lt;/span&gt;
            &lt;/div&gt;
            &lt;div class=&quot;input-field col s6&quot;&gt;
    …</description>
    </item>
    <item rdf:about="https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:registracija_routov&amp;rev=1673515089&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-01-12T09:18:09+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>nodejs:express:registracija_routov</title>
        <link>https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:registracija_routov&amp;rev=1673515089&amp;do=diff</link>
        <description>регистрация роутов

server.js


const express = require('express');//Подключаем модуль
const exphbs = require('express-handlebars');//Подключаем шаблонизатор
const app= express();//Результат работы модуля express, по сути создает сервер
const PORT = process.env.PORT || 3000; //Получить порт из переменного окружения или использовать дефолтный

/**
 * ПОдключаем роуты
 */
const aboutRoutes = require('./routes/about');//Страница about

const hbs= exphbs.create({//Настройки шаблонизатора
    default…</description>
    </item>
    <item rdf:about="https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:rendering_dannyx_v_shablon&amp;rev=1673515089&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-01-12T09:18:09+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>nodejs:express:rendering_dannyx_v_shablon</title>
        <link>https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:rendering_dannyx_v_shablon&amp;rev=1673515089&amp;do=diff</link>
        <description>рендеринг данных в шаблон


/**
 * Обработать get запрос
 * главная страница
 * первый параметр адрес страницы
 * второй параметр callback - обработчик запроса req - request , запрос от браузера
 * res - response, ответ сервера
 */
app.get('/', (req, res) =&gt; {
    res.status(200);//вернуть статус ответа

    res.render('index',{
        title: 'Главная станица',//Передаем в шаблон параметры
        isHome: true
    });//рендерим используя шаблонизатор
});…</description>
    </item>
    <item rdf:about="https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:routy_s_prefiksami&amp;rev=1673515089&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-01-12T09:18:09+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>nodejs:express:routy_s_prefiksami</title>
        <link>https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:routy_s_prefiksami&amp;rev=1673515089&amp;do=diff</link>
        <description>роуты с префиксами

server.js


const express = require('express');//Подключаем модуль
const path = require('path');//Модуль для работы с путями к файлам и папкам
const exphbs = require('express-handlebars');//Подключаем шаблонизатор
const app= express();//Результат работы модуля express, по сути создает сервер
const PORT = process.env.PORT || 3000; //Получить порт из переменного окружения или использовать дефолтный

/**
 * ПОдключаем роуты
 */
const aboutRoutes = require('./routes/about');//Стр…</description>
    </item>
    <item rdf:about="https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:server_s_html_stranicami&amp;rev=1673515089&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-01-12T09:18:09+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>nodejs:express:server_s_html_stranicami</title>
        <link>https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:server_s_html_stranicami&amp;rev=1673515089&amp;do=diff</link>
        <description>Сервер с HTML страницами


const express = require('express');//Подключаем модуль
const path = require('path');
const app= express();//Результат работы модуля express, по сути создает сервер
const PORT = process.env.PORT || 3000; //Получить порт из переменного окружения

/**
 * Обработать get запрос
 * главная страница
 * первый параметр адрес страницы
 * второй параметр callback - обработчик запроса req - request , запрос от браузера
 * res - response, ответ сервера
 */
app.get('/', (req, res) …</description>
    </item>
    <item rdf:about="https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:sozdanie_servera&amp;rev=1673515089&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-01-12T09:18:09+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>nodejs:express:sozdanie_servera</title>
        <link>https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:sozdanie_servera&amp;rev=1673515089&amp;do=diff</link>
        <description>Создание сервера


const express = require('express');//Подключаем модуль
const app= express();//Результат работы модуля express, по сути создает сервер
const PORT = process.env.PORT || 3000; //Получить порт из переменного окружения



app.listen(PORT, () =&gt; {//Слушать 3000 порт
    console.log(`server is running on port ${PORT}`);
});</description>
    </item>
    <item rdf:about="https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:ustanovka&amp;rev=1673515089&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-01-12T09:18:09+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>nodejs:express:ustanovka</title>
        <link>https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:ustanovka&amp;rev=1673515089&amp;do=diff</link>
        <description>[Express Logo]

Fast, unopinionated, minimalist web framework for node.

[NPM Version] [NPM Downloads] [Linux Build] [Windows Build] [Test Coverage]


const express = require('express')

const app = express()

app.get('/', function (req, res) {

  res.send('Hello World')

})

app.listen(3000)


Installation

This is a Node.js module available through the</description>
    </item>
    <item rdf:about="https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:vyvod_spiskov_v_shablone&amp;rev=1673515089&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-01-12T09:18:09+0000</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>nodejs:express:vyvod_spiskov_v_shablone</title>
        <link>https://dokuwiki.webmastermsk.ru/doku.php?id=nodejs:express:vyvod_spiskov_v_shablone&amp;rev=1673515089&amp;do=diff</link>
        <description>вывод списков в шаблоне

routes/courses.js


const {Router} = require('express'); //или const express.Router = require('express');
const Course = require('../models/course');//модель для вывода списков курсов
const router = Router();//инициализируем роутер


/**
 *страница courses
 * первый параметр адрес страницы
 * второй параметр callback - обработчик запроса req - request , запрос от браузера
 * res - response, ответ сервера
 */
router.get('/',async (req, res) =&gt; {
    const courses = await …</description>
    </item>
</rdf:RDF>
