Some checks failed
Build, Test, and Publish (to Private NPM Registry) UI Components Library / publish (push) Failing after 56s
26 lines
No EOL
807 B
TypeScript
26 lines
No EOL
807 B
TypeScript
import express from 'express';
|
|
import type { RequestHandler, Request, Response } from 'express';
|
|
import baWebComponents from '../dist/index.js';
|
|
|
|
const app = express();
|
|
app.set('view engine', 'ejs');
|
|
app.set('views', './test-harness/views');
|
|
|
|
// Mount the library using your virtual path strategy
|
|
app.use(await baWebComponents<RequestHandler>({ expressApp: app }));
|
|
|
|
app.get('/', (req: Request, res: Response) => {
|
|
res.send('Hello from the test server! Navigate to /test/tooltip to see the tooltip component test page.');
|
|
});
|
|
|
|
app.get('/test/tooltip', (req: Request, res: Response) => {
|
|
res.render('tooltip');
|
|
});
|
|
|
|
app.get('/test/drawer', (req: Request, res: Response) => {
|
|
res.render('drawer');
|
|
});
|
|
|
|
app.listen(3080, () => {
|
|
console.log('Test server running on http://localhost:3080');
|
|
}); |