Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jakegrella/townsquare-backend
frontend: https://github.com/jakegrella/townsquare-frontend, backend: https://github.com/jakegrella/townsquare-backend
https://github.com/jakegrella/townsquare-backend
Last synced: 9 days ago
JSON representation
frontend: https://github.com/jakegrella/townsquare-frontend, backend: https://github.com/jakegrella/townsquare-backend
- Host: GitHub
- URL: https://github.com/jakegrella/townsquare-backend
- Owner: jakegrella
- License: mit
- Created: 2021-01-18T03:15:04.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-04T17:54:44.000Z (over 3 years ago)
- Last Synced: 2024-08-01T13:35:14.469Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 245 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Comake Node Database
There are two versions of the backend for this project. This repo contains only the version created with Node.js.
## Endpoints
---
### Auth
url: `/auth`
| Method | url | parameters | payload | returns |
| :----: | --------- | ---------- | ---------------------------------------------------------- | ----------------------------------------------------- |
| `POST` | /register | - | { (string) username, (string) password, (string) zipCode } | adds user, returns new user |
| `POST` | /login | - | { (string) username, (string) password } | logs in user, returns success message including token |---
### Posts (Issues)
url: `/api/posts`
| Method | url | parameters | payload | returns |
| :------: | ------------------ | ----------------- | ------------------------------------------- | ------------------------------------- |
| `GET` | / | - | - | all posts |
| `GET` | /z/:zipCode | (string) zip code | - | all posts for single location |
| `GET` | /u/:username | (string) username | - | all posts by single user |
| `GET` | /p/:postId/likes | (int) post_id | - | all likes on a single post |
| `GET` | /u/:username/likes | (string) username | - | all posts liked by single user |
| `POST` | /p/create | - | { (string) description, (string) imageUrl } | creates new post, returns post |
| `PUT` | /p/:postId | (int) post_id | whichever from above needs updated | updates post, returns post |
| `DELETE` | /p/:postId | (int) post_id | - | deletes post, returns success message |---
### Likes
url: `/api/likes`
| Method | url | parameters | payload | returns |
| :------: | ------- | ---------- | ----------------- | ---------------------- |
| `POST` | /like | - | { (int) post_id } | liked post |
| `DELETE` | /unlike | - | { (int) post_id } | unlike success message |---
### Users
url: `/api/users`
| Method | url | parameters | payload | returns |
| :------: | ---------- | -------------- | ------- | ------------------------------------- |
| `DELETE` | /:username | (int) username | - | deletes user, returns success message |---