schema-mapper-store
v0.4.2
Published
A node API, CLI and REST API to manage schemas and store data.
Downloads
9
Readme
schema-mapper-store
A node API, CLI and REST API to manage schemas and store data.
Usage
CLI
Installation
npm install -g schema-mapper-store
# using build in help
schema-mapper-store --help
# using opts
schema-mapper-server \
--project [ file --path /tmp/project ] \
--expose [ websocket --port 7000 ] \
--expose [ rest --port 7100 ] \
--expose [ admin --port 7200 ] \
--driver [ elasticsearch --host http://localhost:9200 ] \
--driver [ postgresql --host localhost --user postgres --password schemamapper ] \
--driver [ leveldb --path /tmp/level ]
# using environment variables
export STORE_PROJECT_STRATEGY=file
export STORE_PROJECT_FILE_PATH=/tmp/project
export STORE_EXPOSE_STRATEGIES=websocket,rest,admin
export STORE_EXPOSE_WEBSOCKET_PORT=7000
export STORE_EXPOSE_REST_PORT=7100
export STORE_EXPOSE_ADMIN_PORT=7200
export STORE_DRIVER_STRATEGIES=elasticsearch,postgresql,leveldb
export STORE_DRIVER_ELASTICSEARCH_HOST=http://localhost:9200
export STORE_DRIVER_POSTGRESQL_HOST=localhost
export STORE_DRIVER_POSTGRESQL_USER=postgres
export STORE_DRIVER_POSTGRESQL_PASSWORD=schemamapper
export STORE_DRIVER_LEVELDB_PATH=/tmp/level
schema-mapper-server
Node API
Installation
npm install --save schema-mapper-store
var store = require('schema-mapper-store');
store.createServer({
project: 'file',
expose: ['websocket'],
storage: ['leveldb', 'elasticsearch', 'postgresql'],
config: {
project: {
path: '/tmp/project'
},
expose: {
websocket: {
port: 9000
}
},
storage: {
leveldb: {
path: '/tmp/leveldb'
},
elasticsearch: {
hosts: ['http://localhost:9200']
},
postgresql: {
user: 'postgres',
password: 'schemamapper',
host: 'localhost'
}
}
}
});
Docker compose
store:
image: schemamapper/store
ports:
- "7000:7000"
- "7100:7100"
- "7200:7200"
links:
- postgresql
- elasticsearch
volumes:
- /data-leveldb:/data-leveldb
- /data-projects:/data-projects
environment:
- STORE_PROJECT_STRATEGY=file
- STORE_PROJECT_FILE_PATH=/data-schemamapper
- STORE_EXPOSE_STRATEGIES=websocket,rest,admin
- STORE_EXPOSE_WEBSOCKET_PORT=7000
- STORE_EXPOSE_REST_PORT=7100
- STORE_EXPOSE_ADMIN_PORT=7200
- STORE_DRIVER_STRATEGIES=elasticsearch,postgresql,leveldb
- STORE_DRIVER_ELASTICSEARCH_HOST=http://elasticsearch:9200
- STORE_DRIVER_POSTGRESQL_HOST=postgresql
- STORE_DRIVER_POSTGRESQL_USER=postgres
- STORE_DRIVER_POSTGRESQL_PASSWORD=schemamapper
- STORE_DRIVER_LEVELDB_PATH=/data-leveldb
- DEBUG=*
postgresql:
image: schemamapper/postgresql-postgis-uuid
environment:
- POSTGRES_PASSWORD=schemamapper
ports:
- "5432:5432"
volumes:
- /data-postgresql:/var/lib/postgresql/data
elasticsearch:
image: elasticsearch
ports:
- "9200:9200"
volumes:
- /data-elasticsearch:/usr/share/elasticsearch/data
authorizedkeys:
image: tutum/authorizedkeys
environment:
- AUTHORIZED_KEYS=ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEApzubzNrYNSYv66Hbv92ChEJLS+2d0+u4FvktO1iE6jFRx2UL9Xk8SmGoP6+MYPrzaZutZudqrcf8tBH028snPzMOKoXiNJeqS0wGeGegR4l1lHHfk5T+1F5aziEBpun7etV1M0iNWEP8oK8Rr7NDMqnYOGUTFa8k/fuwvOslDMxmESX5wh6J0k8dDVTrSIXCJnpL0AAwFfuGwl5mm8iCZwi4xTyINwwjkZMAthG/BhJV4FolTxyFKGC/ZN+a418SUgLP6FUJ7C6HCjwjNZON77IJHquQsYJc+Gqz69H6jodYeRXD9f3UMI/JL2k1ti3aDqmnF+W0NWhFO51RSKLQvQ== [email protected]
volumes:
- /root:/user:rw
API docs
Licence
MIT