diff --git a/configure-script.js b/configure-script.js index 5edb806..e708a87 100644 --- a/configure-script.js +++ b/configure-script.js @@ -33,7 +33,7 @@ const question = (prompt, def = null) => { const appPort = await question('App Port', '3100'); const appDBUser = await question('DB User', appName); - const appDBPass = await question('DB Pass', uuid()); + const appDBPass = await question('DB Pass', 'venusaur'); const dbRootPass = await question('DB Root Pass'); const appSecretAccess = await question('Access Token Secret', uuid(32)); diff --git a/test/dev-news-requests.rest b/test/dev-news-requests.rest index 12db194..b39fa4f 100644 --- a/test/dev-news-requests.rest +++ b/test/dev-news-requests.rest @@ -1,23 +1,34 @@ #Query -GET https://dev-news.eggtrainer.com/news HTTP/1.1 +GET https://dev-news.krgamestudios.com/news HTTP/1.1 + +### + +#Login +POST https://dev-auth.krgamestudios.com/auth/login HTTP/1.1 +Content-Type: application/json + +{ + "email": "example@example.com", + "password": "helloworld" +} ### #Publish -POST https://dev-news.eggtrainer.com/news HTTP/1.1 +POST https://dev-news.krgamestudios.com/news HTTP/1.1 Content-Type: application/json Authorization: Bearer { "title": "Hello World", - "author": "Kayne Ruse", + "author": "Anonymous", "body": "Lorem ipsum." } ### #Edit -PATCH https://dev-news.eggtrainer.com/news/1 HTTP/1.1 +PATCH https://dev-news.krgamestudios.com/news/1 HTTP/1.1 Content-Type: application/json Authorization: Bearer @@ -28,6 +39,6 @@ Authorization: Bearer ### #Delete -DELETE https://dev-news.eggtrainer.com/news/1 HTTP/1.1 +DELETE https://dev-news.krgamestudios.com/news/1 HTTP/1.1 Content-Type: application/json Authorization: Bearer diff --git a/test/localhost-requests.rest b/test/localhost-requests.rest new file mode 100644 index 0000000..4dcd728 --- /dev/null +++ b/test/localhost-requests.rest @@ -0,0 +1,44 @@ +#Query +GET http://localhost:3100/news HTTP/1.1 + +### + +#Login +POST https://dev-auth.krgamestudios.com/auth/login HTTP/1.1 +Content-Type: application/json + +{ + "email": "example@example.com", + "password": "helloworld" +} + +### + +#Publish +POST http://localhost:3100/news HTTP/1.1 +Content-Type: application/json +Authorization: Bearer + +{ + "title": "Hello World", + "author": "Anonymous", + "body": "Lorem ipsum." +} + +### + +#Edit +PATCH http://localhost:3100/news/1 HTTP/1.1 +Content-Type: application/json +Authorization: Bearer + +{ + "title": "Goodnight World" +} + +### + +#Delete +DELETE http://localhost:3100/news/1 HTTP/1.1 +Content-Type: application/json +Authorization: Bearer diff --git a/test/requests.rest b/test/requests.rest deleted file mode 100644 index 7563224..0000000 --- a/test/requests.rest +++ /dev/null @@ -1,54 +0,0 @@ -#Login to the auth-server -POST http://127.0.0.1:3200/auth/login HTTP/1.1 -Content-Type: application/json - -{ - "email": "kayneruse@gmail.com", - "password": "helloworld" -} - -### - -#Refresh from the auth-server -POST http://127.0.0.1:3200/auth/token HTTP/1.1 -Content-Type: application/json - -{ - "token": "" -} - -### - -#Query -GET http://127.0.0.1:3100/news HTTP/1.1 - -### - -#Publish -POST http://127.0.0.1:3100/news HTTP/1.1 -Content-Type: application/json -Authorization: Bearer - -{ - "title": "Hello World", - "author": "Kayne Ruse", - "body": "Lorem ipsum dolor sit amet..." -} - -### - -#Edit -PATCH http://127.0.0.1:3100/news/5 HTTP/1.1 -Content-Type: application/json -Authorization: Bearer - -{ - "title": "Goodnight World" -} - -### - -#Delete -DELETE http://127.0.0.1:3100/news/4 HTTP/1.1 -Content-Type: application/json -Authorization: Bearer diff --git a/tools/debug-startup.sql b/tools/debug-startup.sql new file mode 100644 index 0000000..ca3349f --- /dev/null +++ b/tools/debug-startup.sql @@ -0,0 +1,4 @@ +#use this while debugging +CREATE DATABASE IF NOT EXISTS news; +CREATE USER IF NOT EXISTS 'news'@'%' IDENTIFIED BY 'venusaur'; +GRANT ALL PRIVILEGES ON news.* TO 'news'@'%';