install json-server package using
$npm install -g json-server
Now create fake REST API as below
create db.json file
{
}
run below command from the same directory where db.json is saved.
$ json-server --watch db.json
Now if you go to http://localhost:3000/posts/1, you'll get
references:
https://www.npmjs.com/package/json-server
alternative way explained in https://www.npmjs.com/package/angular2-in-memory-web-api / https://www.concretepage.com/angular-2/angular-2-http-post-example
$npm install -g json-server
Now create fake REST API as below
create db.json file
{
}
run below command from the same directory where db.json is saved.
$ json-server --watch db.json
Now if you go to http://localhost:3000/posts/1, you'll get
references:
https://www.npmjs.com/package/json-server
alternative way explained in https://www.npmjs.com/package/angular2-in-memory-web-api / https://www.concretepage.com/angular-2/angular-2-http-post-example
Angular : The Big Picture (PluralSight Training)
command to create new project
ng new DRAFTRTI
command to create new component
navigate to directory of project like cd DRAFTRTI
ng g c draft
to run the application run
ng serve
No comments:
Post a Comment