https://github.com/mediacomem/comem-rest-demo
Demonstration REST API implemented with Express
https://github.com/mediacomem/comem-rest-demo
Last synced: 11 months ago
JSON representation
Demonstration REST API implemented with Express
- Host: GitHub
- URL: https://github.com/mediacomem/comem-rest-demo
- Owner: MediaComem
- License: mit
- Created: 2017-02-21T08:30:59.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2024-09-24T14:52:06.000Z (over 1 year ago)
- Last Synced: 2025-04-04T18:38:29.590Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://demo.archioweb.ch
- Size: 1.69 MB
- Stars: 1
- Watchers: 3
- Forks: 3
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# COMEM+ REST Demo
A demonstration RESTful API implemented with [Express][express].
[](https://github.com/MediaComem/comem-rest-demo/actions/workflows/build.yml)
[](https://github.com/MediaComem/comem-rest-demo/actions/workflows/publish.yml)
[](https://opensource.org/licenses/MIT)
- [Requirements](#requirements)
- [Usage](#usage)
- [Configuration](#configuration)
- [API Resources](#api-resources)
- [Automated tests](#automated-tests)
## Requirements
- [Node.js][node] 22.x
- [MongoDB][mongo] 7.x
## Usage
```bash
# Clone the application.
git clone git@github.com:MediaComem/comem-rest-demo.git
# Install dependencies.
cd comem-rest-demo
npm ci
# Start the application in development mode.
DEBUG=demo:* npm start
```
Visit [http://localhost:3000](http://localhost:3000).
To automatically reload the code and re-generate the API documentation on
changes, use `npm run dev` instead of `npm start`.
## Configuration
The application will attempt to connect to the MongoDB database at
`mongodb://localhost/comem-rest-demo` by default.
Use the `$DATABASE_URL` or the `$MONGODB_URI` environment variables to specify a
different connection URL.
## API Resources
This API allows you to work with **Movies** and **People**. A Movie MUST have
one **director** (who is a Person).
Read the [full documentation][docs] to know more.
## Automated tests
This application has an automated test suite which you can run with `npm test`.
It will attempt to connect to the MongoDB database at
`mongodb://localhost/comem-rest-demo-test`.
The tests are implemented with [Mocha][mocha], [Chai][chai] and
[SuperTest][supertest].
[chai]: https://www.chaijs.com
[docs]: https://demo.archioweb.ch
[express]: https://expressjs.com
[mocha]: https://mochajs.org
[mongo]: https://www.mongodb.com
[node]: https://nodejs.org
[supertest]: https://github.com/visionmedia/supertest#readme