diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3fbb277..cea9076 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,18 +1,9 @@ -image: node - -before_script: - - yarn --cwd frontend install - -cache: - paths: - - frontend/node_modules/ - -variables: - BASE_URL: "/notes-tfe/" +image: alpine:latest pages: + stage: deploy script: - - yarn --cwd frontend run generate + - echo 'Nothing to do...' artifacts: paths: - public diff --git a/frontend/nuxt.config.js b/frontend/nuxt.config.js index d54d0d0..e472262 100644 --- a/frontend/nuxt.config.js +++ b/frontend/nuxt.config.js @@ -115,11 +115,6 @@ export default { }, }, }, - - generate: { - dir: '../public', - }, - /* ** Build configuration */ diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..16062d5 --- /dev/null +++ b/public/index.html @@ -0,0 +1,465 @@ +Notes API

Notes API

Accounts

Create an account

POST http://localhost:5000/user
Requestsexample 1
Headers
Content-Type: application/json
Body
{
+  "username": "babar",
+  "email": "michel@seed-it.eu",
+  "password": "tortue"
+}
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "username": {
+      "type": "string"
+    },
+    "email": {
+      "type": "string"
+    },
+    "password": {
+      "type": "string"
+    }
+  }
+}
Responses200409
Headers
Content-Type: application/json
Body
{
+  "message": "Created"
+}
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "message": {
+      "type": "string"
+    }
+  }
+}
Headers
Content-Type: application/json
Body
{
+  "message": "User already exists"
+}
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "message": {
+      "type": "string"
+    }
+  }
+}

Register a new user
POST/user


Authenticate user

Authenticate one user to access protected routing.

+
POST http://localhost:5000/user/login
Requestsexample 1
Headers
Content-Type: application/json
Body
{
+  "username": "babar",
+  "password": "tortue"
+}
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "username": {
+      "type": "string"
+    },
+    "password": {
+      "type": "string"
+    }
+  }
+}
Responses200401
Headers
Content-Type: application/json
Body
{
+  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
+}
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "token": {
+      "type": "string"
+    }
+  }
+}
Headers
Content-Type: application/json
Body
{
+  "description": "Invalid credentials",
+  "error": "Bad Request",
+  "status_code": 401
+}
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "description": {
+      "type": "string"
+    },
+    "error": {
+      "type": "string"
+    },
+    "status_code": {
+      "type": "number"
+    }
+  }
+}

Authenticate a user
POST/user/login


Get User Info

Receive the username and email from the currently logged in user

+
GET http://localhost:5000/user/me
Requestsexample 1
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Responses200
Headers
Content-Type: application/json
Body
{
+  "user": {
+    "username": "Jean",
+    "email": "abc@def.ghi"
+  }
+}
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "user": {
+      "type": "object",
+      "properties": {
+        "username": {
+          "type": "string"
+        },
+        "email": {
+          "type": "string"
+        }
+      }
+    }
+  }
+}

Get User Info
GET/user/me


Notes

Notes

GET http://localhost:5000/notes
Requestsexample 1
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Responses200
Headers
Content-Type: application/json
Body
[
+  {
+    "title": "Kotlin",
+    "tags": [
+      "Dev",
+      "Server"
+    ],
+    "updatedAt": "2020-01-20T00:00:00"
+  },
+  {
+    "title": "Java",
+    "tags": [
+      "Dev"
+    ],
+    "updatedAt": "2018-01-20T00:00:00"
+  }
+]
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "array"
+}

Get Notes
GET/notes


Note

POST http://localhost:5000/notes/Kotlin
Requestsexample 1
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Body
{
+  "tags": [
+    "Dev",
+    "Server"
+  ]
+}
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "tags": {
+      "type": "array"
+    }
+  }
+}
Responses201409
This response has no content.
This response has no content.

Create a Note
POST/notes/{noteTitle}

URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

+

GET http://localhost:5000/notes/Kotlin
Requestsexample 1
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Responses200404
Headers
Content-Type: application/json
Body
{
+  "tags": [
+    "Dev",
+    "Server"
+  ],
+  "chapters": [
+    {
+      "title": "Introduction",
+      "content": "..."
+    },
+    {
+      "title": "Objects",
+      "content": "..."
+    }
+  ]
+}
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "tags": {
+      "type": "array"
+    },
+    "chapters": {
+      "type": "array"
+    }
+  }
+}
This response has no content.

Get Note
GET/notes/{noteTitle}

URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

+

PATCH http://localhost:5000/notes/Kotlin
Requestsexample 1example 2
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Body
{
+  "title": "NewTitle"
+}
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "title": {
+      "type": "string"
+    }
+  }
+}
Responses200404
This response has no content.
This response has no content.
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Body
{
+  "tags": [
+    "new",
+    "tags"
+  ]
+}
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "tags": {
+      "type": "array"
+    }
+  }
+}
Responses200404
This response has no content.
This response has no content.

Update a Note
PATCH/notes/{noteTitle}

URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

+

DELETE http://localhost:5000/notes/Kotlin
Requestsexample 1
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Responses200404
This response has no content.
This response has no content.

Delete Note
DELETE/notes/{noteTitle}

URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

+

Chapters

POST http://localhost:5000/notes/Kotlin/chapters/Kotlin
Requestsexample 1
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Body
{
+  "title": "Chapter 1",
+  "content": "..."
+}
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "title": {
+      "type": "string"
+    },
+    "content": {
+      "type": "string"
+    }
+  }
+}
Responses201404
This response has no content.
This response has no content.

Post a chapter
POST/notes/{noteTitle}/chapters/{chapterNumber}

URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

+
chapterNumber
number (required) Example: Kotlin

The chapter number.

+

PATCH http://localhost:5000/notes/Kotlin/chapters/Kotlin
Requestsexample 1example 2
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Body
{
+  "title": "new title"
+}
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "title": {
+      "type": "string"
+    }
+  }
+}
Responses200404
This response has no content.
This response has no content.
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Body
{
+  "content": "..."
+}
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "content": {
+      "type": "string"
+    }
+  }
+}
Responses200404
This response has no content.
This response has no content.

Patch a chapter
PATCH/notes/{noteTitle}/chapters/{chapterNumber}

URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

+
chapterNumber
number (required) Example: Kotlin

The chapter number.

+

DELETE http://localhost:5000/notes/Kotlin/chapters/Kotlin
Requestsexample 1
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Responses200404
This response has no content.
This response has no content.

Delete a chapter
DELETE/notes/{noteTitle}/chapters/{chapterNumber}

URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

+
chapterNumber
number (required) Example: Kotlin

The chapter number.

+

Tags

Tags

GET http://localhost:5000/tags
Requestsexample 1
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Responses200
Headers
Content-Type: application/json
Body
{
+  "tags": [
+    "Dev",
+    "Server"
+  ]
+}
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "tags": {
+      "type": "array"
+    }
+  }
+}

Get all tags
GET/tags


Generated by aglio on 23 Apr 2020

\ No newline at end of file