RESTful Web API implemented in TypeScript using Node.js, Express.js, JWT, MongoDB, Mongoose and Heroku.
Install dependencies:
npm i
Run on localhost:8080:
nodemon
Replace the connection string in app.ts
with your own:
private static configureDatabase(): void {
- mongoose.connect('mongodb+srv://stock-exchange:stock-exchange@stock-exchange-btfeh.mongodb.net/' +
- 'test?retryWrites=true&w=majority', {
+ mongoose.connect('your-connection-string', {
useNewUrlParser: true,
useCreateIndex: true
});
}
Field | Type | POST / PUT |
---|---|---|
_id |
ObjectId |
|
created |
Date |
|
description |
String |
required |
link |
String |
required |
modified |
Date |
|
title |
String |
required |
userId |
ObjectId |
Field | Type | POST / PUT |
---|---|---|
_id |
ObjectId |
|
created |
Date |
|
description |
String |
required |
modified |
Date |
|
title |
String |
required |
userId |
ObjectId |
Field | Type | POST |
---|---|---|
_id |
ObjectId |
|
amount |
Number |
required |
comment |
String |
required |
date |
Date |
required |
symbol |
String |
required |
userId |
ObjectId |
Field | Type | POST |
---|---|---|
_id |
ObjectId |
|
email |
String |
required |
password |
String |
required |
/articles |
200 | 201 | 401 | 404 | 409 | 500 |
---|---|---|---|---|---|---|
GET | ✓ | ✗ | ✓ | ✓ | ✗ | ✓ |
POST | ✗ | ✓ | ✓ | ✗ | ✗ | ✓ |
/articles/:id |
200 | 201 | 401 | 404 | 409 | 500 |
---|---|---|---|---|---|---|
GET | ✓ | ✗ | ✓ | ✓ | ✗ | ✓ |
PUT | ✓ | ✗ | ✓ | ✗ | ✗ | ✓ |
DELETE | ✓ | ✗ | ✓ | ✓ | ✗ | ✓ |
/notes |
200 | 201 | 401 | 404 | 409 | 500 |
---|---|---|---|---|---|---|
GET | ✓ | ✗ | ✓ | ✓ | ✗ | ✓ |
POST | ✗ | ✓ | ✓ | ✗ | ✗ | ✓ |
/notes/:id |
200 | 201 | 401 | 404 | 409 | 500 |
---|---|---|---|---|---|---|
GET | ✓ | ✗ | ✓ | ✓ | ✗ | ✓ |
PUT | ✓ | ✗ | ✓ | ✗ | ✗ | ✓ |
DELETE | ✓ | ✗ | ✓ | ✓ | ✗ | ✓ |
/transactions |
200 | 201 | 401 | 404 | 409 | 500 |
---|---|---|---|---|---|---|
GET | ✓ | ✗ | ✓ | ✓ | ✗ | ✓ |
POST | ✗ | ✓ | ✓ | ✗ | ✗ | ✓ |
/transactions/:id |
200 | 201 | 401 | 404 | 409 | 500 |
---|---|---|---|---|---|---|
DELETE | ✓ | ✗ | ✓ | ✓ | ✗ | ✓ |
/users/register |
200 | 201 | 401 | 404 | 409 | 500 |
---|---|---|---|---|---|---|
POST | ✗ | ✓ | ✗ | ✗ | ✓ | ✓ |
/users/login |
200 | 201 | 401 | 404 | 409 | 500 |
---|---|---|---|---|---|---|
POST | ✓ | ✗ | ✓ | ✓ | ✗ | ✓ |
Asterisk indicates that an access token is required.
This is a back-end part of Stock Exchange Application.
Visit also a front-end repository: github.com/plkpiotr/stock-exchange-frontend
Copyright © 2019, Piotr Pałka. Released under the MIT License.