Spiel Connect get all the endpoints and its methods therefore you don't need to set any endpoints and services in your frontend application. It is adapted to spiel-server but you can build your own alternatives.
import { Connect, IRequestConfigConnect } from "spiel-connect";
import { IServerTest } from "./services";
const requestConnect: IRequestConfigConnect = {
domain: "http://localhost:3000",
};
const connect = new Connect(request).getEndpoints();
connect.then((server: IServerTest) => {
...
});
connect.then(async (server: IServerTest) => {
const user = {id: 5};
const permission = { permission: "root"};
const response = await server.User.updateUser(user, null, permission);
console.log(response);
});
You can use another backend framework but you need to build the endpoints response and it has to look like this:
[{ name: 'ClassName1',
props: [ { method: 'methodName', name: 'classMethodName', path: '/pathname' },
{ method: 'methodName', name: 'classMethodName', path: '/pathname' },
{ method: 'methodName', name: 'classMethodName', path: '/pathname' },
...
]
},
{ name: 'ClassName2',
props: [{ method: 'methodName', name: 'classMethodName', path: '/pathname' },
{ method: 'methodName', name: 'classMethodName', path: '/pathname' },
{ method: 'methodName', name: 'classMethodName', path: '/pathname' },
...
]
},
...
}]
To get some idea to do it see more here
npm run server
npm test
Spiel Connect is MIT licensed. See license
Generated using TypeDoc