Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const http = require('http');
- const url = require('url');
- const port = 8888;
- http.createServer((request, response) => {
- let currentPath = url.parse(request.url).pathname;
- switch (currentPath) {
- case '/hang':
- var i = 0;
- while (i < 9000000000) {
- i += 1;
- }
- response.write(currentPath);
- response.end();
- break;
- default:
- response.write(currentPath);
- response.end();
- }
- }).listen(port);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement