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

Desc #145

Open
wants to merge 12 commits into
base: feature/documentation
Choose a base branch
from
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
.env
/api/config/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ This project is part of the following Open Source programs:

- [Django Docs](https://docs.djangoproject.com/en/3.0/)
- [React Docs](https://reactjs.org/docs/getting-started.html)
- [Node.js Docs](https://nodejs.org/api/)
- [Node.js Docs](https://nodejs.org/api)
- [Git and GitHub](https://www.digitalocean.com/community/tutorials/how-to-use-git-a-reference-guide)


Expand Down
21 changes: 21 additions & 0 deletions api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Water Monitoring API

## Installation

`npm install`

## Setting up

- Create a config folder in api/
- Create dev.json or test.json file based on your usecase
- Add the following code to dev/test.json

`{"dbURI":"YOUR DATABASE URI"}`

## Running

`npm start`

## Testing

`npm test`
10 changes: 10 additions & 0 deletions api/models/Reading.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const mongoose = require("mongoose");

const readingSchema = new mongoose.Schema({
value: {
required: true,
type: String
}
});

module.exports = mongoose.model("reading", readingSchema);
Loading