Skip to content

Commit 664d931

Browse files
Jaime Salas ZancadaJaime Salas Zancada
authored andcommitted
added basic routes
1 parent 7159e11 commit 664d931

File tree

11 files changed

+1713
-35
lines changed

11 files changed

+1713
-35
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
DATABASE_URL=mongodb://localhost:27017
1+
DATABASE_URL=
2+
HOST=
3+
PORT=
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# backend
2+
3+
## Running Locally
4+
5+
This application has a direct dependency with mongo. To running locally by default the application expects that mongo is listening on port 27017.
6+
7+
It's going to connect with `TopicstoreDb` on mongo server, and it's foing to interact with `Topics` collection.
8+
9+
It's important to mention, that the default connection string is `mongodb://localhost:27017`, we can override it, using env variables.
10+
11+
The following are environment variables that we can set up:
12+
13+
```ini
14+
DATABASE_URL=
15+
HOST=
16+
PORT=
17+
```
18+
19+
Notice that `HOST` is set by default on `localhost` and `PORT` on `5000`. These are the settings to stablish where the HTTP application is listening. You don't need to change it.
20+
21+
With the database running you can check the appliaction by running:
22+
23+
```bash
24+
npm start
25+
```
26+
27+
And then call it with;
28+
29+
```bash
30+
curl http://localhost:5000/api/topics
31+
```
32+

0 commit comments

Comments
 (0)