Skip to content
Snippets Groups Projects
Verified Commit 2149dc51 authored by theMackabu's avatar theMackabu :smile_cat:
Browse files

add mock server to tests

parent 937f4e95
No related branches found
No related tags found
No related merge requests found
node_modules
\ No newline at end of file
{
"scripts": {
"start": "tsx src/index.ts"
},
"dependencies": {
"@hono/node-server": "^0.4.0",
"hono": "^3.1.6"
},
"devDependencies": {
"tsx": "^3.12.2"
}
}
import { Hono } from 'hono';
import { logger } from 'hono/logger';
import { serve } from '@hono/node-server';
import { bearerAuth } from 'hono/bearer-auth';
const app = new Hono();
const port = 3500;
const token = '';
app.use('*', logger());
app.use('/api/*', bearerAuth({ prefix: '', token: 'test_token' }));
app.get('/api/health', (c) =>
c.json({
uptime: '168.44d',
version: '0.2.1',
engine: 'docker',
status: {
healthy: true,
ping: 36,
message: 'All services running',
containers: ['build', 'build/ui'],
},
})
);
console.log(`started on ${port}`);
serve({ fetch: app.fetch, port: port });
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment