Skip to content

Commit

Permalink
feat: Support ESM (+ additional rollup refactor) (#160)
Browse files Browse the repository at this point in the history
* Update rollup config

* Update examples

* Update es folder

* Add rollup script back

* Prevent rollup from running livereload on build

* Declare empty obj for object.keys

* feat: Add renovate

* Use ENV for moltin client ID or fallback

* Remove production node ENV export

* chore: Only disable babel module transform in Rollup config

* chore: Update babel packages
  • Loading branch information
notrab authored and ynnoj committed Jun 18, 2018
1 parent 3a62fb8 commit b79f50b
Show file tree
Hide file tree
Showing 9 changed files with 13,210 additions and 1,989 deletions.
11 changes: 10 additions & 1 deletion .babelrc
@@ -1,3 +1,12 @@
{
"presets": ["stage-3", "env"]
"presets": [
"@babel/preset-stage-3",
[
"@babel/preset-env",
{
"useBuiltIns": "entry"
}
]
],
"plugins": ["transform-class-properties"]
}
19 changes: 19 additions & 0 deletions examples/express-app/index.js
@@ -0,0 +1,19 @@
const express = require('express')
const MoltinGateway = require('@moltin/sdk').gateway

const app = express()

const Moltin = MoltinGateway({
client_id:
process.env.MOLTIN_CLIENT_ID || 'j6hSilXRQfxKohTndUuVrErLcSJWP15P347L6Im0M4'
})

app.get('/', async (req, res) => {
const { data } = await Moltin.Products.All()

res.json({
data
})
})

app.listen(4000, () => console.log('Listening on localhost:4000'))

0 comments on commit b79f50b

Please sign in to comment.