aboutsummaryrefslogtreecommitdiffstats
path: root/test/server.js
blob: 268018cc10b1a550d2cfcb6f6c9b9f96e847ef0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import express from "express";
import mockServer from "./middleware-mockserver.cjs";
import fs from "fs";

const nameHTML = fs.readFileSync( "./test/data/name.html", "utf8" );
const app = express();

app.use( mockServer() );

app.post( "/test/data/name.html", function( _req, res ) {
	res.send( nameHTML );
} );

app.use( "/dist", express.static( "dist" ) );
app.use( "/src", express.static( "src" ) );
app.use( "/test", express.static( "test" ) );
app.use( "/external", express.static( "external" ) );

app.listen( 3000, function() {
  console.log( "Server is running on port 3000" );
} );