Usage

To enable the module, make sure you have a server configuration as documented.

Then, simply attach the ResourceServer middleware to your express app.

import express, { Application } from "express";
import ResourceServer, { ServerConfig, Event, Events, Notifications, Storage, Datasource } from "@ssofy/express-server";
import cors from "cors";
...
// CORS is necessary for testings endpoints via SSOfy Panel's Endpoint Tester 
app.use(cors());

// Enable JSON Request/Response
app.use(express.json());

// Server Config
const serverConfig: ServerConfig = {
    ...
};

// Resource Server
app.use(ResourceServer(serverConfig));

const port = process.env.PORT || 3000;
app.listen(port, () => {
    console.log(`Server is running on port ${port}`);
});

You should now have access to the endpoints described in routes page.

ssofyKnowledge Base
At our core, we believe that staying up-to-date with the latest trends and advancements in Authentication and related areas is essential. That's why we take great pride in keeping you informed with the latest insights, updates, and news in this rapidly evolving landscape.


Do you need support?
SSOfy is by Cubelet Ltd.
Copyright © 2024 Cubelet Ltd. All rights reserved.