please look at my question !!!!
for this nodejs router
const http = require("http");
const url = require('url');
var hostName = '127.0.0.1';
var port = 3000;
var server = http.createServer(function(req,res){
res.setHeader('Content-Type','text/plain');
const parsed = url.parse(req.url);
const pathname = parsed['pathname']
const queryObject = url.parse(req.url,true).query;
let queryValue = queryObject['name']if(queryValue==null){
queryValue=""
}
if (pathname=="/"){
res.end("SUCCESS!")
}
else if (pathname=="/echo"){
res.end("SUCCESS! echo")
}
else if (pathname=="/foxtrot/:name"){
queryValue = queryObject['name'].toString()
res.end("SUCCESS! Received "+queryValue+" via foxtrot")
}
else{
res.end("FAILED! Fix your URL.")
}
})
server.listen(port,hostName,()=>{
console.log(`Server running at http://${hostName}:${port}/`);
});
--------------
it runs like this picture
i wnat to fix it ,when i run
http://127.0.0.1:3000/foxtrot/kilo ,it should work and
it shows "SUCCESS! Received kilo via foxtrot"
how to change it ?
Step by stepSolved in 3 steps with 1 images
- Implement a part of functionality for the Netflix DVD queue. It's a service that allows a user to create a list of desired movies and then sends DVDs with movies on top of this list to the subscriber one at a a time. A subscriber should be able to create a list of desired movies and manipulate the order in a movie queue in their account. Your program will implement some of the desired functionality by storing the list of movie titles in a linked list. You are provided with the following files available in "Downloadable files" section: • MovieList.h contains a class declaration for the class that represents a list of movies. • Driver.cpp contains a main function you can use to test your implementation. You will be responsible for providing the MovieList.cpp file, including the implementation of the MovieList member functions (described below): MovieList and ~MovieList: creates an empty list, and deallocates all the nodes in the list, respectively. display(ostream& out) Print movie…arrow_forwarddef test_corr_coef(): list1 = [78.9, 75.8, 77.3, 74.2, 78.1, 72.8, 77.6, 77.9] list2 = [56.7, 53.1, 56.1, 55.9, 54.1, 48.6, 59.4, 54.0] assert round(corr_coef(list1, list2), 2) == 0.64 return test_corr_coef# Unit testprint (test_corr_coef) I added the print function and get this return please help.arrow_forwardunique please Your task for this assignment is to identify a spanning tree in one connected undirected weighted graph using C++. Implement a spanning tree algorithm using C++. A spanning tree is a subset of the edges of a connected undirected weighted graph that connects all the vertices together, without any cycles. The program is interactive. Graph edges with respective weights (i.e., v1 v2 w) are entered at the command line and results are displayed on the console. Each input transaction represents an undirected edge of a connected weighted graph. The edge consists of two unequal non-negative integers in the range 0 to 9 representing graph vertices that the edge connects. Each edge has an assigned weight. The edge weight is a positive integer in the range 1 to 99. The three integers on each input transaction are separated by space. An input transaction containing the string “end-of-file” signals the end of the graph edge input. After the edge information is read, the process…arrow_forward
- @Override// interface method ==================================================public int merge(BST nbt) {/*See BST.java for method specification */// Hint: traverse bst using pre-order// as each node is visited, take the value there// and do this.insert(value)// have to somehow count when an add is successful// so we can return the number of nodes added/* Your code here */return 0; // Dummy return statement. Remove when you implement!} in java fill out method should merge two bst and not add duplicatesarrow_forwardCode to implement a command-line search auto complete interface won't work, whats the problem? #include <iostream> #include <fstream> #include <string> #include <vector> const int ALPHABET_SIZE = 28; class Trie { private: structTrieNode { //Node struct which contains a a child node for each letter of the alphabet TrieNode *children[ALPHABET_SIZE]; boolisEndOfWord;//bool to determine if letter is the last in a word TrieNode() {//constructor to initially set every child node to empty, and bool to false for (int i = 0; i < ALPHABET_SIZE; i++) { children[i] = NULL; } isEndOfWord = false; } ~TrieNode() {//deconstructor for (int i = 0; i < ALPHABET_SIZE; i++) { if (children[i] != NULL) { deletechildren[i]; } } } }; TrieNode *root;//pointer to point to first letter in word public: Trie() { root = newTrieNode(); //new node is created for first letter inserted } ~Trie() { deleteroot; } //this function inserts every word in the dictionary to the…arrow_forwarddef upgrade_stations(threshold: int, num_bikes: int, stations: List["Station"]) -> int: """Modify each station in stations that has a capacity that is less than threshold by adding num_bikes to the capacity and bikes available counts. Modify each station at most once. Return the total number of bikes that were added to the bike share network. Precondition: num_bikes >= 0arrow_forward
- In javascript: move the first <li> tag from the second <ol> tag to be the last <li> tag in the first <ol>.arrow_forwardCreate an implementation of each LinkedList, Queue Stack interface provided For each implementation create a tester to verify the implementation of thatdata structure performs as expected Your task is to: Implement the LinkedList interface ( fill out the implementation shell). Put your implementation through its paces by exercising each of the methods in the test harness Create a client ( a class with a main ) ‘StagBusClient’ which builds a bus route by performing the following operations on your linked list: Create (insert) 4 stations List the stations Check if a station is in the list (print result) Check for a station that exists, and one that doesn’t Remove a station List the stations Add a station before another station. List the stations Add a station after another station. Print the stations StagBusClient.java package app; import linkedList.LinkedList; import linkedList.LinkedListImpl; public class StagBusClient { public static void main(String[] args) { // create…arrow_forwardQuestion 15 Why does our node class have two versions of the link member function? One is public, the other is private. One is to use with a const pointer, the other with a regular pointer. One returns the forward link, the other returns the backward link. One returns the data, the other returns a pointer to the next node.arrow_forward
- The following step is used to remove first node from the AVAIL list. NEW: =AVAIL AND AVAIL: =LINK[AVAIL] Select one: True Falsearrow_forwardBecause a class may derive from a number of different interfaces, interfaces aid in the establishment of stronger is-a links. if anything is genuine or a fakearrow_forwardHomework #2 Q1: A set of LANS are linked using bridges to create the bridged network depicted by the figure bellow. The bridges communicate configuration BPDUS to build a spanning tree to prevent loops within the network. If all bridges start the spanning tree algorithm (all bridges are initialized), answer the following questions (assume that the circles in the figure are the bridges and the ID for each bridge is the number inside these circles. Also assume that the state of each bridge is changing in sequence according to the information in each question) B3 B5 B1 B2 F B7 B6 B4 a) What is the initial configuration BPDU for B6? b) What is the configuration BPDU of B2 after receiving the initial configuration BPDU of B7? c) If B3 accepted B2 as the root, what is the configuration BPDU of B3? d) If B3 accepted B1 as the root through B5, what is the configuration BPDU of B3? e) Which bridge is the designated bridge of LAN C at this time? f) Now, if B7 accepted B1 as the root, what is the…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education