<commit_before>var express = require('express');
var pdf = require("./markDownPdf");
var fs = require("fs");
var path = require('path');
var readable = require('stream').Readable;
var bodyParser = require('body-parser');
var markdownpdf = require("markdown-pdf")

var app = express();
app.use(bodyParser.json()); // support json encoded bodies
app.use(express.static(path.resolve("../client/")));
app.use(bodyParser.urlencoded({extended: true})); // support encoded bodies


app.get('/', function (req, res) {
    // res.sendFile(__dirname + "/../index.html")

    res.sendFile(path.resolve( "../client/index.html"));
});

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

    res.sendFile(path.resolve( "../client/edit.html"))
});

app.post("/makepdf", function (req, res) {
    var s = new readable();
    // console.log("makepdf execute:" + req.body.content);

    s.push(req.body.content);
    s.push(null);
    s.pipe(markdownpdf()).pipe(res);
});

var server = app.listen(80, function () {

    // var host = server.address().address;
    // var port = server.address().port;
    //
    // console.log("应用实例，访问地址为 http://%s:%s", host, port)
    console.log("应用实例，访问地址为 http://localhost:80/");

})
<commit_msg>Update server.js<commit_after>var express = require('express');
var pdf = require("./markDownPdf");
var fs = require("fs");
var path = require('path');
var readable = require('stream').Readable;
var bodyParser = require('body-parser');
var markdownpdf = require("markdown-pdf")

var app = express();
app.use(bodyParser.json()); // support json encoded bodies
app.use(express.static(path.resolve("../client/")));
app.use(bodyParser.urlencoded({extended: true})); // support encoded bodies


app.get('/', function (req, res) {
    // res.sendFile(__dirname + "/../index.html")

    res.sendFile(path.resolve( "../client/index.html"));
});

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

    res.sendFile(path.resolve( "../client/edit.html"))
});

app.post("/makepdf", function (req, res) {
    var s = new readable();
    console.log("makepdf execute:" + req.body.content);

    s.push(req.body.content);
    s.push(null);
    s.pipe(markdownpdf()).pipe(res);
});

var server = app.listen(80, function () {

    // var host = server.address().address;
    // var port = server.address().port;
    //
    // console.log("应用实例，访问地址为 http://%s:%s", host, port)
    console.log("应用实例，访问地址为 http://localhost:80/");

})

{'fraction_non_alphanumeric': 0.20746388443017658, 'fraction_numerical': 0.0032102728731942215, 'mean_word_length': 3.2542662116040955, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5239612', 'n_tokens_mistral': 849, 'n_tokens_neox': 825, 'n_words': 155}