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
/* | |
* Minimal CRUD API code example using Yup schema | |
*/ | |
import app from 'codehooks-js' | |
import crudlify from 'codehooks-crudlify-yup' | |
import * as yup from 'yup'; | |
// "product" schema allowing any json object | |
const product = yup.object().shape({ | |
json: yup.mixed() |
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
curl --location --request POST 'https://xxxx-edf3.restdb.io/rest/employees' \ | |
--header 'apikey: xxxxx' \ | |
--header 'Content-Type: application/json' \ | |
--data-raw '{ | |
"ecode": "bbbbbb", | |
"lname": "Tester", | |
"address": "home street", | |
"fname": "Test", | |
"active": true, | |
"email": "tester@tester.com" |
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
function test(){ | |
} |
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
var getArticleLoadOptions = function(){ | |
return { | |
"url": currentArticleUrl, | |
"data": { _ajax: true }, | |
"type": "GET", | |
"dataType": "html", | |
"beforeSend": setRequestHeaders | |
} | |
}; |
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
request = require 'supertest' | |
assert = require 'assert' | |
app = (require '../../app').app # remember to export app from your app file!! | |
before(done)-> | |
# some code to remove all tasks | |
# ... | |
done() # asynch callback to tell mocha to go to the next step/spec | |
describe 'simple todo API',-> |
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
<html> | |
<h1>hei</h1> | |
</html> |
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
it 'should fetch items from capsule',(done)-> | |
capsuleservice.fetchItemsFromCapsule requestMock, null, (err,items)-> | |
if not err | |
items.should.have.lengthOf 4 | |
done() |