mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Replace express with native http module
* refactor: replace express with native http module * fix: 404 when unhandled * chore: removed express dependency * chore: updated package-lock.json * docs: added documentation for BaseHttpServerFactory * chore: updated package-lock.json Co-authored-by: Arthur Joppart <arthur@digita.ai>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { Server } from 'http';
|
||||
import request from 'supertest';
|
||||
import type { ExpressHttpServerFactory } from '../../src/server/ExpressHttpServerFactory';
|
||||
import type { BaseHttpServerFactory } from '../../src/server/BaseHttpServerFactory';
|
||||
import type { HttpHandlerInput } from '../../src/server/HttpHandler';
|
||||
import { HttpHandler } from '../../src/server/HttpHandler';
|
||||
import { StaticAsyncHandler } from '../util/StaticAsyncHandler';
|
||||
@@ -15,18 +15,18 @@ class SimpleHttpHandler extends HttpHandler {
|
||||
}
|
||||
}
|
||||
|
||||
describe('An Express server with middleware', (): void => {
|
||||
describe('An http server with middleware', (): void => {
|
||||
let server: Server;
|
||||
|
||||
beforeAll(async(): Promise<void> => {
|
||||
const factory = await instantiateFromConfig(
|
||||
'urn:solid-server:default:ExpressHttpServerFactory', 'server-middleware.json', {
|
||||
'urn:solid-server:default:HttpServerFactory', 'server-middleware.json', {
|
||||
'urn:solid-server:default:PodManagerHandler': new StaticAsyncHandler(false, null),
|
||||
'urn:solid-server:default:LdpHandler': new SimpleHttpHandler(),
|
||||
'urn:solid-server:default:variable:port': port,
|
||||
'urn:solid-server:default:variable:baseUrl': 'https://example.pod/',
|
||||
},
|
||||
) as ExpressHttpServerFactory;
|
||||
) as BaseHttpServerFactory;
|
||||
server = factory.startServer(port);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user