Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maulana Ghozi Humama #2

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
123 changes: 122 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,122 @@
# mini-wp
# Hackticle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coba nanti dilengkapi :D


```
Client :
http://winiwp-ghz.maulanaghozi.web.id

BaseURL / Server :
http://35.187.228.79
```

## **List of User Routes** :

| HTTP | Routes | Headers | Body | Description |
| --- | ----- | --- | --- | --- |
| POST | /users | none | name,email, password | Register new user |
| POST | /users/login | none | email,password | Login user |
| POST | /users/signin | none | token | Login 3rd API (google) |

---

## **List of Article Routes**

| HTTP | Routes | Headers | Body | Description |
| --- | ----- | --- | --- | --- |
| GET | /articles/userId | token | none | read all article where author is user id |
| POST | /articles | token | {title, content, tags, published, photo} | Create new Article (authentication) |
| PUT | /articles/:id | token | {title, content, tags, published, photo} | Update article (authentication, authoriation) |
| DELETE | /articles/:id | token | none | Delete image (authentication, authorization) |

---

## **Response**

1. Routes : /users
- Method : POST
```
Response :
{
"data": {
"_id": "5d7eedb4e0824c0c4dxxxxx",
"name": "admin",
"password": "xxxxxxxxxxxxxxxxxxx",
"email": "[email protected]",
"createdAt": "2019-09-16T02:04:36.901Z",
"updatedAt": "2019-09-16T02:04:36.901Z",
"__v": 0

}
}
```

2. Routes : /users/login
- Method : POST
```
Response :
{
"message": "Login Success",
"id": "5d7eedb4e0xxxxxxxxxxxx",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2VlZGI0ZTA4MjRjMGM0ZGE1ZWFjYiIsImVtYWlsIjoiYWRtaW5AZ21haWwuY29tIiwiaWF0IjoxNTY4NTk5NTkzfQ.Lxxxxxxxxxxxxxxxxxxxxxxx"
}
```

3. Routes : /users/signin
- Method : POST
```
Response :
{
"message": "Login Success",
"id": "5d7eedb4e0xxxxxxxxxxxx",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkN2VlZGI0ZTA4MjRjMGM0ZGE1ZWFjYiIsImVtYWlsIjoiYWRtaW5AZ21haWwuY29tIiwiaWF0IjoxNTY4NTk5NTkzfQ.Lxxxxxxxxxxxxxxxxxxxxxxx"
}
```

4. Routes : /articles
- Method : POST
```
Response :
{
"tags": [
"makan",
"minum",
"hacktiv8",
"tidur"
],
"_id": "5d7f16ffe0824xxxxxxx",
"title": "Siswa kelas 9 berhasil menembus security google",
"author": "5d7eedb4e0824c0c4dxxxxxx",
"content": "kita harus bangga pada siswa kelas 9 ini karena kecerdasannya dia dapat masuk ke dalam security google",
"published": true,
"photo": "https://images.unsplash.com/photo-1498050108023-c5249f4df085?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60",
"createdAt": "2019-09-16T05:00:47.303Z",
"updatedAt": "2019-09-16T05:00:47.303Z"
}
```


4. Routes : /articles/userId
- Method : GET
```
Response :
{
"articles": [
{
"tags": [
"makan",
"minum",
"hacktiv8",
"tidur"
],
"_id": "5d7f16ffe0824c0c4xxxxxxx",
"title": "Siswa kelas 9 berhasil menembus security google",
"author": "5d7eedb4e0824c0c4dxxxxx",
"content": "kita harus bangga pada siswa kelas 9 ini karena kecerdasannya dia dapat masuk ke dalam security google",
"published": true,
"photo": "https://images.unsplash.com/photo-1498050108023-c5249f4df085?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60",
"createdAt": "2019-09-16T05:00:47.303Z",
"updatedAt": "2019-09-16T05:00:47.303Z"
}, ........
],
"Author": "admin"
}
```
3 changes: 3 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.cache
dist
32 changes: 32 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://www.fontify.me/wf/de776f4ae91f407b7752acbaa9433770" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Work+Sans&display=swap" rel="stylesheet">
<meta name="google-signin-client_id"
content="1076346870616-g67nkvgg398aenfju4u3u59252e4rrd7.apps.googleusercontent.com">
<title>Hackticle</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'helvetica', arial, sans-serif;
}
</style>
</head>

<body>
<div id="App"></div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@8"></script>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ketika menggunakan npm install, tidak perlu lagi menggunakan CDN

<script src="https://apis.google.com/js/platform.js" async defer></script>
<script src="https://apis.google.com/js/api:client.js"></script>
<script src="https://kit.fontawesome.com/5cd1e1d933.js"></script>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kalo dari data network ini yang bkin berat

<script src="./src/main.js"></script>
</body>

</html>
Loading