[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/expresscpp/expresscpp/master/test/basic_.js [Back]  [Original]

const express = require('express');
const app = express();
const fetch = require('node-fetch');
const assert = require('assert');

app.get("/", (req, res) => {
  res.send("/")
})

const port = 8082;
const server = app.listen(port, () => {
  fetch(`http://localhost:${port}/`)
    .then(async (r) => {
      const response = await r.text();
      assert(response === "/");
      server.close();
    })
    .catch((e) => {
      console.error('ERROR: ' + e)
      assert(false);
    });
});

Web Proxy Viewer  |  New URL  |  Original Page