dvspandey / RubiksCube3x3

Give details of 6 faces of 3x3 Rubik's Cube and get a solution in terms of Rotation Steps
0 stars 0 forks source link

First Deploy and get JSON Response Done! #19

Closed dvspandey closed 3 years ago

dvspandey commented 3 years ago

Team Hello,

This is Not a BUG or ISSUE don't get excited to solve, But here we announced great News! We are Done up to 98% of the Overall project for ### Launching Version 1.0

First Deploy and get JSON Response Done!

Here, we are ready to get a response from the server-side with JSON format data [Keys, Values] fields....! The Big task getting completed, Congratulations....!

Also Up to here, we get always the same response from the server-side of each request because the request handle cone is not DONE! there is Hardcoded Cube is working internally so, this process is under process Now, but there is the maximum possibility it will also be done by tomorrow evening and we will deploy our project and get request and send a response as with respect to particular requests!

Here, I attached our First JSON format data which is Successfully Generated by our JAVA based server,

image image

@Akshaywebdev888

Get Ready Team,

---dvspandey

dvspandey commented 3 years ago

JSON Data by Postman

[ { "cube": [ [ [ "Y", "Y", "Y" ], [ "Y", "Y", "Y" ], [ "Y", "Y", "Y" ] ], [ [ "B", "B", "B" ], [ "B", "B", "B" ], [ "B", "B", "B" ] ], [ [ "R", "R", "R" ], [ "R", "R", "R" ], [ "R", "R", "R" ] ], [ [ "G", "G", "G" ], [ "G", "G", "G" ], [ "G", "G", "G" ] ], [ [ "O", "O", "O" ], [ "O", "O", "O" ], [ "O", "O", "O" ] ], [ [ "W", "W", "W" ], [ "W", "W", "W" ], [ "W", "W", "W" ] ] ], "s1": { "cube": [ [ [ "Y", "Y", "Y" ], [ "Y", "Y", "Y" ], [ "Y", "Y", "Y" ] ], [ [ "B", "B", "B" ], [ "B", "B", "B" ], [ "B", "B", "B" ] ], [ [ "R", "R", "R" ], [ "R", "R", "R" ], [ "R", "R", "R" ] ], [ [ "G", "G", "G" ], [ "G", "G", "G" ], [ "G", "G", "G" ] ], [ [ "O", "O", "O" ], [ "O", "O", "O" ], [ "O", "O", "O" ] ], [ [ "W", "W", "W" ], [ "W", "W", "W" ], [ "W", "W", "W" ] ] ], "myRotations": " R' U B U B U L2" }, "s2": { "cube": [ [ [ "Y", "Y", "Y" ], [ "Y", "Y", "Y" ], [ "Y", "Y", "Y" ] ], [ [ "B", "B", "B" ], [ "B", "B", "B" ], [ "B", "B", "B" ] ], [ [ "R", "R", "R" ], [ "R", "R", "R" ], [ "R", "R", "R" ] ], [ [ "G", "G", "G" ], [ "G", "G", "G" ], [ "G", "G", "G" ] ], [ [ "O", "O", "O" ], [ "O", "O", "O" ], [ "O", "O", "O" ] ], [ [ "W", "W", "W" ], [ "W", "W", "W" ], [ "W", "W", "W" ] ] ], "myRotations": " U B2 U F2 L2 U R2" }, "s3": { "cube": [ [ [ "Y", "Y", "Y" ], [ "Y", "Y", "Y" ], [ "Y", "Y", "Y" ] ], [ [ "B", "B", "B" ], [ "B", "B", "B" ], [ "B", "B", "B" ] ], [ [ "R", "R", "R" ], [ "R", "R", "R" ], [ "R", "R", "R" ] ], [ [ "G", "G", "G" ], [ "G", "G", "G" ], [ "G", "G", "G" ] ], [ [ "O", "O", "O" ], [ "O", "O", "O" ], [ "O", "O", "O" ] ], [ [ "W", "W", "W" ], [ "W", "W", "W" ], [ "W", "W", "W" ] ] ], "myRotations": " R' D' R D' F' D F D' D' D' L' D L D' D' R' D R" }, "s4": { "cube": [ [ [ "Y", "Y", "Y" ], [ "Y", "Y", "Y" ], [ "Y", "Y", "Y" ] ], [ [ "B", "B", "B" ], [ "B", "B", "B" ], [ "B", "B", "B" ] ], [ [ "R", "R", "R" ], [ "R", "R", "R" ], [ "R", "R", "R" ] ], [ [ "G", "G", "G" ], [ "G", "G", "G" ], [ "G", "G", "G" ] ], [ [ "O", "O", "O" ], [ "O", "O", "O" ], [ "O", "O", "O" ] ], [ [ "W", "W", "W" ], [ "W", "W", "W" ], [ "W", "W", "W" ] ] ], "myRotations": " U U U UFU'F' U'L'UL U U'F'UF URU'R' U U UBU'B' U'R'UR U ULU'L' U'B'UB" }, "s5": { "cube": [ [ [ "Y", "Y", "Y" ], [ "Y", "Y", "Y" ], [ "Y", "Y", "Y" ] ], [ [ "B", "B", "B" ], [ "B", "B", "B" ], [ "B", "B", "B" ] ], [ [ "R", "R", "R" ], [ "R", "R", "R" ], [ "R", "R", "R" ] ], [ [ "G", "G", "G" ], [ "G", "G", "G" ], [ "G", "G", "G" ] ], [ [ "O", "O", "O" ], [ "O", "O", "O" ], [ "O", "O", "O" ] ], [ [ "W", "W", "W" ], [ "W", "W", "W" ], [ "W", "W", "W" ] ] ], "myRotations": " U FURU'R'F'" }, "s6": { "cube": [ [ [ "Y", "Y", "Y" ], [ "Y", "Y", "Y" ], [ "Y", "Y", "Y" ] ], [ [ "B", "B", "B" ], [ "B", "B", "B" ], [ "B", "B", "B" ] ], [ [ "R", "R", "R" ], [ "R", "R", "R" ], [ "R", "R", "R" ] ], [ [ "G", "G", "G" ], [ "G", "G", "G" ], [ "G", "G", "G" ] ], [ [ "O", "O", "O" ], [ "O", "O", "O" ], [ "O", "O", "O" ] ], [ [ "W", "W", "W" ], [ "W", "W", "W" ], [ "W", "W", "W" ] ] ], "myRotations": " U RUR'URU2R' U U U RUR'URU2R' U U RUR'URU2R'" }, "s7": { "cube": [ [ [ "Y", "Y", "Y" ], [ "Y", "Y", "Y" ], [ "Y", "Y", "Y" ] ], [ [ "B", "B", "B" ], [ "B", "B", "B" ], [ "B", "B", "B" ] ], [ [ "R", "R", "R" ], [ "R", "R", "R" ], [ "R", "R", "R" ] ], [ [ "G", "G", "G" ], [ "G", "G", "G" ], [ "G", "G", "G" ] ], [ [ "O", "O", "O" ], [ "O", "O", "O" ], [ "O", "O", "O" ] ], [ [ "W", "W", "W" ], [ "W", "W", "W" ], [ "W", "W", "W" ] ] ], "myRotations": " U R'FR'B2 RF'R'B2R2 U'" }, "s8": { "cube": [ [ [ "Y", "Y", "Y" ], [ "Y", "Y", "Y" ], [ "Y", "Y", "Y" ] ], [ [ "B", "B", "B" ], [ "B", "B", "B" ], [ "B", "B", "B" ] ], [ [ "R", "R", "R" ], [ "R", "R", "R" ], [ "R", "R", "R" ] ], [ [ "G", "G", "G" ], [ "G", "G", "G" ], [ "G", "G", "G" ] ], [ [ "O", "O", "O" ], [ "O", "O", "O" ], [ "O", "O", "O" ] ], [ [ "W", "W", "W" ], [ "W", "W", "W" ], [ "W", "W", "W" ] ] ], "myRotations": "" } } ]

Akshaywebdev888 commented 3 years ago

As far as I am able to understand the above response, you are sending initial cube position and the position after each steps and rotation. But it's just my advice that if you could send me data like this

data format

I hope you are able to see the above data format in embedded image. Why I am saying that you should send me data like the above is because we don't want the cube status after each steps, it is of no use for the current version in which we are working on and therefore you don't need to send me that. I only want is steps and rotation as the above image showing.

For any further query please comment........

dvspandey commented 3 years ago

In this Format, I need data Via POST request

{ 'cube':[[['G','B','W'],['R','Y','B'],['W','Y','G']],[['G','O','R'],['R','B','G'],['B','Y','R']],[['W','Y','B'],['O','R','B'],['W','W','O']],[['O','O','O'],['W','G','R'],['Y','O','G']],[['Y','Y','O'],['B','O','G'],['R','G','R']],[['B','W','Y'],['R','W','W'],['B','G','Y']]], 'rotations':''}

@Akshaywebdev888

dvspandey commented 3 years ago

All Done!!

Do Post only

image

{ 'cube':[[['G','B','W'],['R','Y','B'],['W','Y','G']],[['G','O','R'],['R','B','G'],['B','Y','R']],[['W','Y','B'],['O','R','B'],['W','W','O']],[['O','O','O'],['W','G','R'],['Y','O','G']],[['Y','Y','O'],['B','O','G'],['R','G','R']],[['B','W','Y'],['R','W','W'],['B','G','Y']]], 'rotations':''}

dvspandey commented 3 years ago

Ready with Some JSP + HTML code!! image

On click Login Button, Send Null data image

@Akshaywebdev888

Be Happy Bro!! :) 👍 Now, we have lots of options!!!!

dvspandey commented 3 years ago

First Testing with UI

https://user-images.githubusercontent.com/58794031/104418660-46252d00-559d-11eb-944e-5cb94b32310b.mp4

@Akshaywebdev888 @dvspandey Status:- Fail

dvspandey commented 3 years ago

BINGO! JAVA server is live [do Get/POST requests]

Link:-

https://dvspandey.herokuapp.com/

image

@Akshaywebdev888 https://dvspandey.herokuapp.com/ @dvspandey https://dvspandey.herokuapp.com/

Akshaywebdev888 commented 3 years ago

Thanks for deployment of the server this would make easy .....

Akshaywebdev888 commented 3 years ago

When I am posting to the https://dvspandey.herokuapp.com/steps I am getting 500 Internal server error

server error

showin 500 error

data which I sent

content type = application/json

{"cube":[[["O","O","O"],["O","Y","O"],["O","O","O"]],[["R","R","R"],["R","B","R"],["R","R","R"]],[["B","B","B"],["B","R","B"],["B","B","B"]],[["Y","Y","Y"],["Y","G","Y"],["Y","Y","Y"]],[["W","W","W"],["W","O","W"],["W","W","W"]],[["G","G","G"],["G","W","G"],["G","G","G"]]],"rotation":""}

dvspandey commented 3 years ago

Try this JSON data:

{ "cube":[[["G","B","W"],["R","Y","B"],["W","Y","G"]],[["G","O","R"],["R","B","G"],["B","Y","R"]],[["W","Y","B"],["O","R","B"],["W","W","O"]],[["O","O","O"],["W","G","R"],["Y","O","G"]],[["Y","Y","O"],["B","O","G"],["R","G","R"]],[["B","W","Y"],["R","W","W"],["B","G","Y"]]], "rotations":""}

@Akshaywebdev888

Akshaywebdev888 commented 3 years ago

Access-Control-Allow-Origin

link:- https://www.digitalocean.com/community/questions/blocked-by-cors-policy-the-access-control-allow-origin-mean-stack

Akshaywebdev888 commented 3 years ago

error

https://stackoverflow.com/questions/20035101/why-does-my-javascript-code-receive-a-no-access-control-allow-origin-header-i

https://web.dev/cross-origin-resource-sharing/

You can change the configuration of your server to allow CORS requests.

Here is an example configuration which turns on CORS on nginx (nginx.conf file) - be very careful with setting always/"$http_origin" for nginx and "*" for Apache - this will unblock CORS from any domain.

dvspandey commented 3 years ago

HeroKu Log

image

Jan 13, 2021 6:47:04 PM org.apache.coyote.http11.AbstractHttp11Processor process INFO: Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.

heroku war:deploy "E:\E drive(Study,clg,programming)\IDEAS\Project-RubiksCube3x3\java-servlet-json-rubiks-cube3.war" --app dvspandey

dvspandey commented 3 years ago

DiscussionDone | All Set up to Version-2