This file contains 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
[ | |
{ | |
"code": "AKJ", | |
"lat": "43.665", | |
"lon": "142.453", | |
"name": "Asahikawa Airport", | |
"city": "Asahikawa-shi", | |
"state": "Hokkaido Prefecture", | |
"country": "Japan", | |
"woeid": "28360516", |
This file contains 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
// continue Connection class... | |
// helper method: getting the path to access the requested resource/information hosted by the server (aka routing) | |
private static Path getFilePath(String path) { | |
Matcher match = Pattern.compile("/watch/").matcher(path); | |
if(match.find()){ | |
// replacing "watch" with "resources" because we have our videos inside that directory | |
path = path.replaceAll("/watch/", "./"); | |
path = path + ".mp4"; | |
return Paths.get(path); |
This file contains 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
// continue Connection class... | |
// overiding run method from Thread class | |
public void run(){ | |
// Initializing a Scanner class to read stream input from the | |
// socket connection between server and client | |
Scanner scan = new Scanner(this.in, "UTF-8"); | |
try{ | |
// separating the HTTP request header from rest of the HTTP message | |
// "\\r\\n\\r\\n" below refers to the 'empty line' from fig.1 |
This file contains 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
// Inside WebServer.java file | |
// Thread class is extended to use multi-threading facility | |
class Connection extends Thread { | |
DataInputStream in; | |
DataOutputStream out; | |
Socket clientSocket; | |
public Connection (Socket clientSocket) { | |
try { | |
this.clientSocket = clientSocket; |
This file contains 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
// Inside WebServer.java file | |
public class WebServer{ | |
public static void main (String args[]) throws IOException NoSuchAlgorithmException { | |
int serverPort = 9090; | |
// allocating resources for server's socket and assigning a port number | |
ServerSocket listenSocket = new ServerSocket(serverPort); | |
try{ | |
System.out.println("Server program started..."); | |
while(true) { | |
// listening to the assigned port number and accepting |
This file contains 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
// Inside WebServer.java file | |
// Some necessary imports | |
import java.net.*; | |
import java.io.*; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import java.security.NoSuchAlgorithmException; |
This file contains 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
<!-- ./public/cats.html --> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Cat Paws</title> | |
</head> | |
<body> | |
<h1 style="text-align: center;">Cat-videos</h1> | |
<div style="display: flex; justify-content: center;"> |
This file contains 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
<!-- ./public/index.html --> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Cat Paws</title> | |
</head> | |
<body> | |
<div> | |
<h1 style="text-align: center;">Cat Paws</h1> |
This file contains 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
/Organization | |
org-login-header | |
org-login-email | |
org-login-password | |
org-login-submit | |
org-login-password-error | |
org-login-email-error | |
org-login-submit-error | |
/Dashboard/Home |
This file contains 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
# staff.feature | |
# this is a background keyword learn more here: https://cucumber.io/docs/gherkin/reference/#background | |
Background: | |
Given a company has been created with following information and default attributes | |
# this is a data table you can learn more from: https://dev.to/jankaritech/datatables-used-in-a-gherkin-feature-file-2i89 | |
| email | pkrwaste@gmail.com | | |
| mobileNo | 9816564565 | | |
| password | password | | |
And super admin has accepted the company | |
And company has logged in with email "" and password "" using the webUI |
NewerOlder