feat: add http gateway (#3)

This commit is contained in:
Morten Olsen
2024-01-12 21:10:48 +01:00
committed by GitHub
parent 9c5249956e
commit 1115ce2fb3
22 changed files with 397 additions and 74 deletions

View File

@@ -18,9 +18,9 @@
}
},
"devDependencies": {
"@morten-olsen/mini-loader-configs": "workspace:^",
"@morten-olsen/mini-loader-cli": "workspace:^",
"@morten-olsen/mini-loader": "workspace:^",
"@morten-olsen/mini-loader-cli": "workspace:^",
"@morten-olsen/mini-loader-configs": "workspace:^",
"@types/node": "^20.10.8",
"typescript": "^5.3.3"
},
@@ -28,5 +28,8 @@
"repository": {
"type": "git",
"url": "https://github.com/morten-olsen/mini-loader"
},
"dependencies": {
"fastify": "^4.25.2"
}
}

View File

@@ -0,0 +1,12 @@
import { http } from '@morten-olsen/mini-loader';
import fastify from 'fastify';
const server = fastify();
server.all('*', async (req) => {
return req.url;
});
server.listen({
path: http.getPath(),
});

View File

@@ -3,6 +3,7 @@ import { artifacts, logger } from '@morten-olsen/mini-loader';
const run = async () => {
await logger.info('Hello world');
await artifacts.create('foo', 'bar');
process.exit(0);
};
run();