https://github.com/neonarray/clue-server
The server counter-part for the Clue WordPress plugin
https://github.com/neonarray/clue-server
express nodejs
Last synced: about 2 months ago
JSON representation
The server counter-part for the Clue WordPress plugin
- Host: GitHub
- URL: https://github.com/neonarray/clue-server
- Owner: NeonArray
- Created: 2019-01-14T20:06:43.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-14T20:27:28.000Z (over 7 years ago)
- Last Synced: 2025-06-30T01:47:01.040Z (12 months ago)
- Topics: express, nodejs
- Language: JavaScript
- Homepage:
- Size: 465 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# "Clue" Server
This node server is part of the larger "Clue" app, which is an [event logger for WordPress](https://github.com/ocularrhythm/clue-client). I believe that this server is partially incomplete, but should be functional in its current state.
As of writing this, I have not touched the code in this app in over a year so I am somewhat fuzzy on some of the details. However, I built this wholly aware that I wanted to "set and forget," so should be easy to reason about if given a little time to read through the code.
The tools used for this app are:
- Node v9.10.1
- Express
- MongoDB with Mongoose
- Mocha/Chai for testing with NYC for coverage reporting
- eslint for quality
[The generated docs for the API can be found here.](https://ocularrhythm.github.io/clue-server/)
## Getting Started
Clone the repository and install dependencies:
```bash
yarn install
```
Install LocalTunnel in order to expose your local environment to the web:
```bash
yarn add localtunnel -G
```
Next, boot up mongodb and run the server:
```bash
mongod
yarn start
```
Lastly start localtunnel with a subdomain of "clue" (to make things easier) and port of `3000`:
```bash
lt -S "clue" -p 3000
```
Test everything works by sending a request for all events:
```bash
curl https://clue.localtunnel.me/api/v1/event
```
You should have received:
```json
{"status":401,"message":""}
```
## API Documentation
The documentation is generated using the `api-doc-generator` package. [The output](./docs/index.html) for this is put into the `docs` directory.
## Testing
The test harness utilized for unit tests is `mocha` and `chai`. Code coverage is generated using `nyc`.
You will need to have an instance of `mongo` running, prior to invoking the tests.
To run the tests:
```bash
sudo mongod
yarn test
```