24 lines
565 B
JavaScript
24 lines
565 B
JavaScript
const fs = require('fs');
|
|
const directory_name = 'lekcja-1-directives';
|
|
|
|
const data = {
|
|
folders: [directory_name],
|
|
lessons: fs.readdirSync(__dirname + "/static/cwiczenia/" + directory_name)
|
|
};
|
|
|
|
const express = require('express');
|
|
const app = express();
|
|
const path = require('path');
|
|
const PORT = 3000;
|
|
|
|
app.get('/page_list', function (req, res) {
|
|
res.send(data);
|
|
});
|
|
|
|
app.use(express.static('static/css'))
|
|
app.use(express.static('static/cwiczenia/' + directory_name))
|
|
|
|
app.listen(PORT, function () {
|
|
console.log(`Start serwera, port: ${PORT}`);
|
|
});
|