From f822c2a3cf01bd6c8985fce2e52b97337b4245ac Mon Sep 17 00:00:00 2001 From: Francisco Pessano Date: Mon, 30 May 2022 14:23:01 -0300 Subject: [PATCH 1/2] Index page fundation --- public/index.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 public/index.html diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..e51bf13 --- /dev/null +++ b/public/index.html @@ -0,0 +1,16 @@ + + + + + + + ORB - (Open React Blog) API + + +

ORB - (Open React Blog) API

+

Available endpoints

+ + + \ No newline at end of file From 33e0eba02f5f7803a3df6c7e80cb3b2889488636 Mon Sep 17 00:00:00 2001 From: Francisco Pessano Date: Mon, 30 May 2022 16:45:30 -0300 Subject: [PATCH 2/2] Index page done --- public/index.html | 61 ++++++++++++++++++++++++++++++++++---- public/styles/global.css | 18 +++++++++++ public/styles/index.css | 27 +++++++++++++++++ src/firebase/firebase.json | 12 ++++++++ src/server.js | 6 +++- 5 files changed, 118 insertions(+), 6 deletions(-) create mode 100644 public/styles/global.css create mode 100644 public/styles/index.css create mode 100644 src/firebase/firebase.json diff --git a/public/index.html b/public/index.html index e51bf13..79829aa 100644 --- a/public/index.html +++ b/public/index.html @@ -5,12 +5,63 @@ ORB - (Open React Blog) API + + + + + + -

ORB - (Open React Blog) API

-

Available endpoints

- +
+

ORB - (Open React Blog) API

+
+
+

Available endpoints

+
    +
  • + /user - Get determinated user data +

    Details:

    +
      +
    • GET Request
    • +
    • +

      Request's Body:

      +
      
      +{
      +    "user": "example" //!REQUIRED 
      +}
      +                        
      +
    • +
    • +

      Returned data:

      +
      
      +{
      +    "username": {
      +        "username": "john-doe",
      +        "displayUsername": "John Doe"
      +    },
      +    "posts": [
      +        {
      +            "id": "id",
      +            "data": {
      +                "readingTime": "1 min.",
      +                "title": "Lorem Ipsum",
      +            },
      +            "date": {
      +                "seconds": 1651334551
      +            },
      +            "post": "Full post",
      +            "shortPost": "Full p..."
      +        }
      +    ]
      +}
      +                        
      +
    • +
    +
  • +
+
+ + \ No newline at end of file diff --git a/public/styles/global.css b/public/styles/global.css new file mode 100644 index 0000000..95fa3f7 --- /dev/null +++ b/public/styles/global.css @@ -0,0 +1,18 @@ +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +html, body { + height: 100%; + width: 100%; +} + +h1, h2, h3, h4, h5, h6 { + font-family: "Poppins", "Arial"; +} + +div, main { + font-family: "Be Vietnam Pro", "Arial"; +} \ No newline at end of file diff --git a/public/styles/index.css b/public/styles/index.css new file mode 100644 index 0000000..fec46b3 --- /dev/null +++ b/public/styles/index.css @@ -0,0 +1,27 @@ +body { + padding: 0px 3vw; +} + +header { + min-height: 15%; + + display: flex; + align-items: center; +} + +main { + +} + +main ul li { + margin-left: 3vw; + margin-top: 1vh; +} + +main ul li p { + margin-top: 0.5vh; +} + +main ul li .endpoint { + color: rgb(243, 58, 26); +} \ No newline at end of file diff --git a/src/firebase/firebase.json b/src/firebase/firebase.json new file mode 100644 index 0000000..6b91671 --- /dev/null +++ b/src/firebase/firebase.json @@ -0,0 +1,12 @@ +{ + "type": "service_account", + "project_id": "open-react-blog", + "private_key_id": "0938570034a6c2a3674daee5333b4a0ed4c67bd0", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCk+cmjkxo8m4Tl\ni2Gtz04hpkUoCEP/1iRYWxpHtlfSUQ4qrbt//XV0g7vgmvQGpQRVhjZFppki+We6\nWDPabQ9mJhBpczpFDHyoF9fAQ20IkNkIyy7yegweB30mdF0Z4m/AeK0jL6J1E0gM\n2bINEiaQZMEC48lib9rWIrZKVf3eQVoJOib7rPO3g+HZs5DavRbhdnefPrY3nbvJ\nKn++AzHZq2VO5wAbb4fTEtEw1fvIOKjMsc35qnHmyG/qZqOjoAXOKGyNojX1wB7B\nEl9a2Cz2/Nq5IiL4xl0eqm8Djwlz4rV5ABeqNKfuy6zWeV67qzjyoMdUuQhWfedy\ntNLNPtrDAgMBA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rgFllz1SD/f+IQKBgQDJePIV2TkGpW4lnaXw\n+HebGhH7qFTnKcEwKOXTFbmOYk/e7NAjy3tmIHMa+d+JvzKX1fWAsv51Hrw2ACUk\nf6z9zEFA9t/AS3p88ZYVItHdOr/2oafuu3BfZ4PUZBEPHFZLBii59r6jULygGxwD\nOE0ZW/Ve0014MQnzwMBDUfaAtg==\n-----END PRIVATE KEY-----\n", + "client_email": "firebase-adminsdk-zdn6x@open-react-blog.iam.gserviceaccount.com", + "client_id": "107878030511443082884", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-zdn6x%40open-react-blog.iam.gserviceaccount.com" +} diff --git a/src/server.js b/src/server.js index 69c7ad5..718224b 100644 --- a/src/server.js +++ b/src/server.js @@ -1,8 +1,12 @@ -const express = require("express") +const express = require("express"); const server = express() const port = 3000 +const path = require("path"); + +server.use(express.static(path.resolve('public'))); + const index = require('./routes/index.js') server.use("/", index)