Application framework built on the top of DNA Web Components.
npm install @chialab/synapse
Synapse • Application framework built on the top of DNA Web Components.
---
Install via NPM or Yarn:
```
npm i @chialab/synapse
``
yarn add @chialab/synapse
`tsx
import { customElement, html, render } from '@chialab/dna';
import { App } from '@chialab/synapse';
@customElement('demo-app')
class DemoApp extends App {
routes = [
{
pattern: '/',
render(req, res) {
return (
Home
);
},
},
{
handler(req, res) {
res.data = new Error('not found');
},
render(req, res) {
return (
${res.data.message}
${res.data.stack}
);
},
},
];
render() {
return (
<>
Synapse 3.0
{super.render()}
>
);
}
}
const app = render(
app.start('/');
`
---


Install the dependencies
``
yarn
and run the build script:
``
yarn build
This will generate the ESM and CJS bundles in the dist folder and declaration files in the types` folder.
---
Synapse is released under the MIT license.