-
Download a snapshot build
-
Start Optic server `java -jar path/to/server.jar
-
Clone the Optic Skills SDK Repo
-
Run
yarn install
-
explore code within /examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
in: { | |
type: "string", | |
enum: ["query", "body", "params", "header"], | |
from: tokenWithValue('query') | |
}, | |
name: { | |
type: "string", | |
from: tokenWithValue('name') | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Express Parameter Lens | |
*/ | |
import {js} from '../sdk-objects/lens/Snippet' | |
import {literalWithValue, tokenWithValue} from "../sdk-objects/lens/Finders"; | |
const lens = js` | |
req.query.name | |
` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//input | |
const toDo = mongoose.model('todo', new mongoose.Schema({ | |
'message': 'string', | |
'isDone': 'string' | |
})) | |
//output | |
app.post('/todo', (req, res)=> { | |
new toDo({ | |
message: req.body.message, |
NewerOlder