This project was generated with Angular CLI version 10.1.2.
- Node 8+
- npm
- elasticsearch
You can use Elastic search as a service, in which case you can skip step 2 & 3.
- Install requirements:
npm install --dev
- Setup elastic search, in
/etc/elasticsearch/elasticsearch.yml
add:
cluster.initial_master_nodes: homenode
network.host: 0.0.0.0
http.cors.enabled : true
http.cors.allow-origin : "*"
http.cors.allow-methods : OPTIONS, HEAD, GET, POST, PUT, DELETE
path.repo: ["/invar/home-inventory"]
- Start elastic search
sudo service elasticsearch start
- Run server:
ng serve
- Create database:
mkdir /invar/home-inventory
. - Register Repository:
curl -XPUT localhost:9200/_snapshot/inventory \
-H 'Content-Type: application/json' \
-d '{
"type": "fs",
"settings": {
"location": "/invar/home-inventory",
"compress": true
}}'
- Create Backup:
# curl -XDELETE localhost:9200/_snapshot/inventory/inventory
curl -XPUT localhost:9200/_snapshot/inventory/inventory \
-H 'Content-Type: application/json' \
-d '{
"indices": "inventory*",
"ignore_unavailable": true,
"include_global_state": false,
"partial": false
}'
- Create Restore:
curl -XPOST localhost:9200/_snapshot/inventory/inventory/_restore \
-H 'Content-Type: application/json' \
-d '{
"indices": "inventory*",
"ignore_unavailable": true,
"include_global_state": false,
"partial": false
}'
- Build:
ng build --prod --base-href https://atb00ker.github.io/home-inventory/
- Deploy:
npx angular-cli-ghpages --dir dist/home-inventory/