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:
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