Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ErickWendel/NodeJSWithTypescript
Generic Repository Pattern, Singleton, Multi-layer Architecture Pattern - Examples
https://github.com/ErickWendel/NodeJSWithTypescript
Last synced: about 2 months ago
JSON representation
Generic Repository Pattern, Singleton, Multi-layer Architecture Pattern - Examples
- Host: GitHub
- URL: https://github.com/ErickWendel/NodeJSWithTypescript
- Owner: ErickWendel
- Created: 2015-12-22T15:52:45.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-16T19:14:18.000Z (almost 8 years ago)
- Last Synced: 2024-07-27T00:25:45.730Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.26 MB
- Stars: 70
- Watchers: 11
- Forks: 20
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Learning.NodeJSWithTypescript
For learning typescript, this project describes the application, at Spartans and Heroes as users of system. The Spartans describes amount of death peoples and Heroes amount of saved peoples.Patterns and Principles in this project:
- Generic Repository Pattern
- Singleton Pattern
- Multi-layer Architecture PatternTools:
- NodeJS
- TypeScript
- ExpressJS
- MongoDB
- Mongoose
- GulpJS
- VSCode Task RunnersConvention Refs:
Coding guidelines Typescript - Microsoft
Pré Requisites:
- NodeJS
- MongoDB
- VSCodeRun:
> npm install
if not executing from VSCode:
> gulp
REST API Definitions:
CREATE
> METHOD: POST
> PARAMS: {"name":"Leonidas King","amountPeopleKilled":120,"folk":"agoge"}
> URL: http://localhost:5000/spartans
> RETURN: success or error
> METHOD: POST
> PARAMS: {"name":"Goku God","power":"sayan","amountPeopleSaved":2000 }
> URL: http://localhost:5000/heroes
> RETURN: success or error
RETRIEVE
> METHOD: GET
> URL: http://localhost:5000/heroes/
> RETURN: [{"name":"Goku God","power":"sayan","amountPeopleSaved":2000 }]
> METHOD: GET
> URL: http://localhost:5000/spartans/
> RETURN: [{"name":"Leonidas King","amountPeopleKilled":120,"folk":"agoge"}]
GET ONE
> METHOD: GET
> URL: http://localhost:5000/heroes/56800b6b01c67c194e603e23
> RETURN: {"name":"Goku God","power":"sayan","amountPeopleSaved":2000 }
> OBSERVATIONS: for this request, use item id in url (56800b6b01c67c194e603e23)
> METHOD: GET
> URL: http://localhost:5000/spartans/568564361cc5056325f52c3c
> RETURN: {"name":"Leonidas King","amountPeopleKilled":120,"folk":"agoge"}
> OBSERVATIONS: for this request, use item id in url (568564361cc5056325f52c3c)
UPDATE
> METHOD: PUT
> PARAMS: {"name":"UPDATED","power":"sayan","amountPeopleSaved":200 }
> URL: http://localhost:5000/heroes/56800afbf34739a94da174f0
> RETURN: success or error
> OBSERVATIONS: for this request, use item id in url (56800afbf34739a94da174f0)
> METHOD: PUT
> PARAMS: {"name":"UPDATED","amountPeopleKilled":2,"folk":"agoge" }
> URL: http://localhost:5000/heroes/56800afbf34739a94da174f0
> RETURN: success or error
> OBSERVATIONS: for this request, use item id in url (56800afbf34739a94da174f0)
DELETE
> METHOD: DELETE
> URL: http://localhost:5000/heroes/56800afbf34739a94da174f0
> RETURN: success or error
> METHOD: DELETE
> URL: http://localhost:5000/spartans/568564361cc5056325f52c3c
> RETURN: success or error
> OBSERVATIONS: for this request, use item id in url (568564361cc5056325f52c3c)