https://github.com/churris-x/snippet-board-server
Backend of Snippet Board website
https://github.com/churris-x/snippet-board-server
backend express nodejs
Last synced: 6 months ago
JSON representation
Backend of Snippet Board website
- Host: GitHub
- URL: https://github.com/churris-x/snippet-board-server
- Owner: churris-x
- License: mit
- Created: 2022-04-19T08:46:08.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-03-27T16:39:23.000Z (about 2 years ago)
- Last Synced: 2024-03-27T17:50:32.366Z (about 2 years ago)
- Topics: backend, express, nodejs
- Language: JavaScript
- Homepage:
- Size: 178 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Snippet Board Backend
Express JS backend server for my Snippet Board website.
Handles user account (login, signup) and snippet CRUD.
## Data structure
Snippets
| Key | Type | Nullable | Notes |
|-------------|---------|----------|-----------------------------|
| id | integer | false | pk, auto increment |
| title | string | false | |
| description | text | true | Long text, varchar |
| body | text | false | Long text, varchar |
| syntax | string | false | default value: 'plain_text' |
## Routes
/
- `GET :4055/` response: 'Hello world!'
/user
- `POST :4055/users/signup` body: { name, email, password }
- `POST :4055/users/login` body: { name, password } response: { token }
- `GET :4055/users/me` header: { Authorization:'Bearer token' } response: { id, name, email }
/snippets
- `GET :4055/snippets/user` header: { Authorization:'Bearer token' } response: {[ userSnippets ]}
- `POST :4055/snippets/user` header: { Authorization:'Bearer token' } body: { title, imgUrl, minimumBid }
- `GET :4055/snippets/user/:postId` header: { Authorization:'Bearer token' } response: { userSnippet }
- `PATCH :4055/snippets/user/:postId` header: { Authorization:'Bearer token' } response: { updatedPost }
- `DELETE :4055/snippets/user/:postId` header: { Authorization:'Bearer token' }
## Technologies
- Express JS
- Sequelize
- JWT Authentication with bcrypt
- Developed with [ElephantSQL](https://www.elephantsql.com/), deployed with [Render](https://www.render.com/)