/server - server part (Json Server
+ Casual
random data generator)
/client - client part (Angular)
To run server part, install it locally with all dependencies using npm:
$ npm install
First of all run this command to generate data for json server (with casual
npm package)
$ npm run generate-data
db.json
will be generated in server directory
Run this command to start server
$ npm run json-serv
server works on http://localhost:3000
get news
get http://localhost:3000/news
get news item
get http://localhost:3000/news/${id}
update news item
patch http://localhost:3000/news/${id}
get most liked news items, not equals id
get http://localhost:3000/news?_limit=4&_sort=likes&_order=desc&id_ne=${id}
To run client part, install it locally with all dependencies using npm:
$ npm install
Angular CLI must be installed globally by following command:
$ npm install -g @angular/cli
Run ng serve
for a dev server.
$ ng serve
Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Note: Project uses remote resources (like images and icons), so internet connection should be established.