Inital code commit
Some checks failed
Build, Test, and Publish (to Private NPM Registry) UI Components Library / publish (push) Failing after 52m26s
Some checks failed
Build, Test, and Publish (to Private NPM Registry) UI Components Library / publish (push) Failing after 52m26s
This commit is contained in:
commit
5024375e20
32 changed files with 5379 additions and 0 deletions
26
test-harness/server.ts
Normal file
26
test-harness/server.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
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({ expressApp: app }) as RequestHandler);
|
||||
|
||||
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');
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue