Cleaned up tools and tests

This commit is contained in:
2021-12-23 13:57:52 +00:00
parent 6e75012376
commit da0c4bbd05
5 changed files with 65 additions and 60 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ const question = (prompt, def = null) => {
const appPort = await question('App Port', '3100'); const appPort = await question('App Port', '3100');
const appDBUser = await question('DB User', appName); 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 dbRootPass = await question('DB Root Pass');
const appSecretAccess = await question('Access Token Secret', uuid(32)); const appSecretAccess = await question('Access Token Secret', uuid(32));
+16 -5
View File
@@ -1,23 +1,34 @@
#Query #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 #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 Content-Type: application/json
Authorization: Bearer Authorization: Bearer
{ {
"title": "Hello World", "title": "Hello World",
"author": "Kayne Ruse", "author": "Anonymous",
"body": "Lorem ipsum." "body": "Lorem ipsum."
} }
### ###
#Edit #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 Content-Type: application/json
Authorization: Bearer Authorization: Bearer
@@ -28,6 +39,6 @@ Authorization: Bearer
### ###
#Delete #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 Content-Type: application/json
Authorization: Bearer Authorization: Bearer
+44
View File
@@ -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
-54
View File
@@ -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
+4
View File
@@ -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'@'%';