moralis-plugins
v1.1.26
Published
![logo](logo.png)
Downloads
9
Keywords
Readme
Moralis Plugins
Code generation for Moralis Plugins
npm install moralis-plugins --global
Create Plugin
moralis-plugins create greetings
cd greetings
Develop Plugin
greetings/src/index.ts
import Moralis from 'moralis-plugins'
const plugin = new Moralis.Plugin({
name: 'Greetings',
description: 'Example greeting plugin',
version: '1.0.0',
})
plugin.define<{ name: string }>(
'hello/:name',
req => {
const a = `Hello, ${req.params.name}`
return a
},
{
description: 'Returns a hello greeting',
returnDescription: 'A hello greeting',
}
)
export default plugin
Build Plugin
moralis-plugins build
Should receive output as follows
Plugin saved to dist
Swagger saved to swagger.yml
Client saved to client
Run Plugin Locally
moralis-plugins serve
Should receive output as follows
Plugin saved to dist
OpenApi Docs at http://localhost:8080/api-docs