5.0.0 • Published 12 months ago
srpc-framework v5.0.0
Usage
const { createServer, createInvalidParamsError } = require('srpc-framework')
const { createServer } = require('http') // or https
const functions = { add: ({ a, b }) => a + b }
const paramsValidationFunctions = {
add: (params) => {
if (params instanceof Object !== true) {
return false
}
return typeof params.a === number && typeof params.b === number
}
}
const limit = '1mb'
const port = 8080
const onStartText = `Server successfully launched on port ${port}`
const { listen: startServer } = createServer({ functions, paramsValidationFunctions, limit, createServer })
startServer(port, onStartText)
Overview
JSON-RPC over HTTP web 'framework'
Specification
It adhere to JSON-RPC 2.0
Exceptions: 1. No id field - no point in it when over HTTP 2. No batch requests - if you need batch requests you wrote your back end poorly and need to refactor it
5.0.0
12 months ago
3.1.1
12 months ago
3.1.0
12 months ago
4.0.1
3 years ago
4.0.0
3 years ago
4.0.3
3 years ago
4.0.2
3 years ago
3.0.0
4 years ago
2.0.15
4 years ago
2.0.16
4 years ago
2.0.13
4 years ago
2.0.14
4 years ago
2.0.11
4 years ago
2.0.12
4 years ago
2.0.10
4 years ago
2.0.17
4 years ago
2.0.9
5 years ago
2.0.5
5 years ago
2.0.4
5 years ago
2.0.7
5 years ago
2.0.6
5 years ago
2.0.8
5 years ago
2.0.3
5 years ago
2.0.2
5 years ago
2.0.1
5 years ago
1.0.19
5 years ago
2.0.0
5 years ago
1.0.18
5 years ago
1.0.17
5 years ago
1.0.16
5 years ago
1.0.15
6 years ago
1.0.14
6 years ago
1.0.13
6 years ago
1.0.12
6 years ago
1.0.11
6 years ago
1.0.10
6 years ago
1.0.9
6 years ago
1.0.8
6 years ago
1.0.7
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago