~romuloalves/get-instagram-feed

4f96bd25ce1a0dc256453cfa2e2fd72a38c3cc22 — Rômulo Alves 4 years ago d5476da
Including option to use with url containing paths
1 files changed, 2 insertions(+), 1 deletions(-)

M src/index.js
M src/index.js => src/index.js +2 -1
@@ 7,6 7,7 @@ const get = require('micro-get')

// Get the port to execute the API
const port = process.env.PORT || 3000
const urlPath = process.env.URL || ''


const {send} = micro


@@ 23,7 24,7 @@ const server = micro(get(async function (req, res) {
  // Verify user
  const {pathname, query} = parse(req.url, true)

  const user = pathname.replace('/', '')
  const user = pathname.replace(`${urlPath}/`, '')
  if (user.length === 0) {
    return send(res, 404, 'User is required.')
  }