mirror of
https://github.com/morten-olsen/mini-loader.git
synced 2026-02-08 01:36:26 +01:00
feat: add http gateway (#3)
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
12
packages/examples/src/http.ts
Normal file
12
packages/examples/src/http.ts
Normal 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(),
|
||||
});
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user