Import data


ItemsAPI is mostly around data. Below there are showed various ways about putting data into the system.

Web form

The code responsible for adding data can be found in ./src/routes.js. It is /add endpoint. The file responsible for how the form looks like can be found in ./views/basic.add.html.twig.

Open form used to collect data from community. You need to set it up for your specific needs.

JSON file

# Start starter
$ PORT=3000 npm start
# Open browser with http://localhost:3000
# You should see installation page
Installation form. Put your JSON file with items and the application will be created out of the box


# Install ItemsAPI CLI
$ npm install -g itemsapi-cli
# Importing data
$ itemsapi items import --collection zouespow --filename data.json --api=http://localhost:5000/api/v1
# Exporting data
$ itemsapi items export --collection zouespow --api=http://localhost:5000/api/v1 > movies.json
Was this page helpful ?