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
// | |
// npm install http-proxy --save | |
// | |
var http = require('http'), | |
httpProxy = require('http-proxy'); | |
// | |
// Create a proxy server with custom application logic | |
// |
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
module.exports = { | |
entry: "./entry.js", | |
output: { | |
path: __dirname, | |
filename: "bundle.js" | |
}, | |
devServer: { | |
proxy: { | |
'/api/*': 'https://my.backend.local' | |
} |
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
/** | |
* Installation: npm install express path | |
* | |
* Create file json/users.json | |
* [ | |
* { | |
* "name": "Marco", | |
* "description": "Test" | |
* },{ | |
* "name": "Another", |
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
# run with $> python SimpleRequestHandler.py 8081 | |
from BaseHTTPServer import HTTPServer | |
from BaseHTTPServer import BaseHTTPRequestHandler | |
import json, sys | |
port = 8080 | |
if len(sys.argv) == 2: | |
port = int(sys.argv[1]) |
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
class ProfileDocTest extends com.devbliss.doctest.DocTest { | |
... | |
/** | |
* Write a test annotated method like you would do for a common junit test | |
*/ | |
@Test | |
public void testDeleteProfile() { | |
/* |
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
assertEqualsAndSay(HttpStatus.SC_NOT_FOUND, response3.httpStatus, "The profile is not found since it has been deleted."); |
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
makeDeleteRequest(buildUri("api/v1/profile/" + profile.id)); |
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
sayNextSection("Delete a profile"); |
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
say("A user with admin rights can delete a profile."); | |
... | |
say("We want to delete the profile with the id \"" + profile.id + "\"."); | |
... | |
say("A request to the delete-profile endpoint with the correct rigths and an existing profile id will end up in a response with the status code " + HttpStatus.SC_NO_CONTENT); |
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
class ProfileDocTest extends com.devbliss.doctest.DocTest { | |
} |
NewerOlder