To start the app, first cd
to the folder where this readme is located. Then:
npm install -g gulp
npm install
gulp
node dist/server.js
This should result in something like:
Users API listening on port 3000
!KEEP THIS TAB OPEN! it will wait for your requests
In your browser, go to http://localhost:3000
This should show a friendly message :).
Other methods, like POST and PATCH and DELETE can only be made from either Postman or from your Angular application.
Response body:
Response - 200 - Body:
{"message": "Users API up and running!"}
Response - 200 - Body:
[
{
"firstName": "Piet",
"lastName": "Friet",
"age": 72,
"email": "[email protected]",
"profilePictureUrl": "http://retailparkroermond.com/nl/horeca/piet-friet/afbeeldingen/piet-friet-l.png",
"_id": "8m0nGYgSttzCNG0t"
}
]
Request body:
{
"firstName": "Piet",
"lastName": "Friet",
"age": 72,
"email": "[email protected]",
"profilePictureUrl": "http://retailparkroermond.com/nl/horeca/piet-friet/afbeeldingen/piet-friet-l.png"
}
Response body:
{
"firstName": "Piet",
"lastName": "Friet",
"age": 72,
"email": "[email protected]",
"profilePictureUrl": "http://retailparkroermond.com/nl/horeca/piet-friet/afbeeldingen/piet-friet-l.png",
"_id": "B1w2s30z2L3n0Jrj"
}
Request body:
{
"firstName": "NewFirstName"
}
Response (if user exists in database) - 204 - Body:
(empty)
Response (if user does not exist in database) - 404 - Body:
{"Reason": "That user does not exist"}
Request body:
{
"firstName": "NewFirstName"
}
Response (if user exists in database) - 204 - Body:
(empty)
Response (if user does not exist in database) - 404 - Body:
{"Reason": "That user does not exist"}
example-api-express-typescript's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.