A collection of examples to help you get started with XpresserJs Esm Framework.
- clone this repo
- run
npm install
to install dependencies - check
exaamples
folder for samples
All examples are written in typescript.
The watch keyword is applied to all examples to enable auto-reload on file changes.
- Basic Example
- Cli Example
- Express Http Server Example
- Node Http Server Example
- Module Example
- Plugin
The basic usage of XpresserJs with only the Cli Module registered.
To run the cli module you can add the cli
keyword after the file path.
npx tsx watch examples/basic.ts
The Cli Module is set as default and used to create a simple cli command.
npx tsx watch examples/cli.ts
- Express Server Module is registered.
- Support with xpresser router handler.
- Support with express router handler.
npx tsx watch examples/express-http-server.ts
- Node Server Module is registered.
- Support with xpresser router handler.
- Support with express router handler.
npx tsx watch examples/node-http-server.ts
This example shows how to create a module using a sample ScrabbleGame
module.
npx tsx examples/module.ts
This example shows how to create the two types of plugin supported by XpresserJs.
- File Based Plugin
- Inline Plugin
The file-based plugin folder is located in examples/demo-plugin
folder.
npx tsx watch examples/plugin.ts
npx tsx watch examples/plugin-inline.ts