Project is using MySQL as default datastore.
See config/datastores.js
:
default: {
adapter: 'sails-mysql',
url: 'mysql://root@localhost:3306/challenge_countries',
},
Refer to Sails :: Waterline ORM for more info.
- Run
npm start
which automatically...- runs
ng serve
to build and serve Angular on port4200
. - runs
sails lift
to lift Express (Sails.js) API on port1337
.
- runs
Cron runs every 24hs with node-cron
.
(every 20 seconds in this demo)
This analizes the differences between the existing data and the new one,
updating only what is necessary while ensuring no loss of data during the process.
CORS is enabled, backend only accepts requests from http://localhost:4200
.
See config/security.js
:
cors: {
allRoutes: true,
allowOrigins: ["http://localhost:4200"],
allowCredentials: true,
allowRequestHeaders: "content-type, authorization"
}
- Filtering by
name
,capital
, and/orcontinent
are performed server-side. - Pagination and ordering are handled client-side.
👋 That would be it.