From c4e59e9cd0238adb9de2c98d790c806128a67ad9 Mon Sep 17 00:00:00 2001 From: Mark Moffat Date: Sun, 7 Jan 2018 14:10:16 +0100 Subject: [PATCH] Add initial testdata --- app.js | 1 + bin/testdata.json | 67 +++++++++++++++++++++++++++++++++++++++++++++++ routes/common.js | 24 ++++++++++++++++- 3 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 bin/testdata.json diff --git a/app.js b/app.js index dd5c101..e0d8f12 100644 --- a/app.js +++ b/app.js @@ -259,6 +259,7 @@ MongoClient.connect(config.databaseConnectionString, {}, (err, client) => { // add indexing common.runIndexing(app) + .then(common.testData(db)) .then(() => { // lift the app app.listen(app.get('port'), () => { diff --git a/bin/testdata.json b/bin/testdata.json new file mode 100644 index 0000000..bd94d2b --- /dev/null +++ b/bin/testdata.json @@ -0,0 +1,67 @@ +[ + { + "productPermalink": "duckworth-jacket", + "productTitle": "Duckworth Woolfill Jacket", + "productPrice": "188.00", + "productDescription": "

Inspired by the timeless, functional style of your grandfather's work coat, the Foraker features brass buttons and 4 patch pockets. Crafted in Bristol, Tennessee, our 10oz organic duck canvas is light enough for an early summer morning, but rugged enough to handle your days work.<\/p>