Soap Express
This page and the plugin itself are still in development, a lot will change.
SoapExpress is a utility package designed to streamline the integration of SoapJS with Express, providing a structured approach to creating and managing Express servers, routes, and authentication. With built-in support for dependency injection and a suite of authentication validators, SoapExpress simplifies the process of building robust, secure APIs.
Features
Seamless integration with SoapJS and Express.
Custom
SoapExpressRouterfor easy route management.SoapExpressServerfor initializing and running Express applications.SoapAuthManagerfor straightforward authentication using various strategies.Supports dependency injection containers.
Simplified authentication setup with pre-defined validators.
Getting Started
To get started with SoapExpress, follow these steps to set up and run your server.
Installation
First, install the package along with its peer dependencies if you haven't already:
npm install @soapjs/soap-express @soapjs/soap express
npm install inversify reflect-metadata
# OR use soap-cli to build new project
soap new projectSetup
Configure Your Server and Router
Create a new file (e.g., index.ts) and import the necessary classes and dependencies. Define your server configuration, create a container for dependency injection, and initialize your custom router and dependencies.
Extend
SoapExpressRouter
Extend SoapExpressRouter to define your routes. Use the provided SoapAuthManager for authentication and validators for different strategies (JWT, Basic Auth, OAuth, etc.).
Define Dependencies
Define a class to manage your application's dependencies.
Running the Server
Run your server using Node.js or a process manager like PM2. Ensure that your entry point (e.g., index.js) is correctly specified.
Your Express server should start, and it will log the listening port to the console.
Last updated