Giter Club home page Giter Club logo

gimme-the-song's Introduction

giphy (1)

Hey, I am

João Victor 👋🏽

Front-end developer developing anything that comes into my mind.

gimme-the-song's People

Contributors

joaovct avatar kausko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kausko

gimme-the-song's Issues

gimme-the-song-fpcalc-linux: command not found

Hi @joaodjtr,
I'm getting the error: gimme-the-song-fpcalc-linux: command not found on my Vercel deployment (Linux). However, it is working perfectly on my local Windows environment, and my code is completely OS-independent.

Here's the complete error log:
{"errorType":"Error","errorMessage":"Command failed: gimme-the-song-fpcalc-linux /tmp/Numb.mp3\n/bin/sh: gimme-the-song-fpcalc-linux: command not found\n","code":127,"killed":false,"signal":null,"cmd":"gimme-the-song-fpcalc-linux /tmp/Numb.mp3","stack":["Error: Command failed: gimme-the-song-fpcalc-linux /tmp/Numb.mp3","/bin/sh: gimme-the-song-fpcalc-linux: command not found",""," at ChildProcess.exithandler (child_process.js:308:12)"," at ChildProcess.emit (events.js:315:20)"," at maybeClose (internal/child_process.js:1048:16)"," at Socket.<anonymous> (internal/child_process.js:439:11)"," at Socket.emit (events.js:315:20)"," at Pipe.<anonymous> (net.js:673:12)"]}

Here's my Next.js source code:

import multer from "multer";
import nextConnect from "next-connect";
import { gimme, setGimmeKey } from 'gimme-the-song'
import { unlink } from 'fs'
import { tmpdir } from 'os'

const handler = nextConnect({
  onError: (err, _req, res) => { 
    console.log(err)
    res.status(501).json({ error: err.message })
   },
  onNoMatch: (req, res) => res.status(405).json({ error: req.method + " not allowed"})
})
.use(
  multer({ 
    storage: multer.diskStorage({
      destination: tmpdir(),
      filename: (_req, file, cb) => cb(null, file.originalname.split(' ').join(''))
    })
  })
  .single('audiofile')
)
.post((req, res) => {
  setGimmeKey(process.env.ACOUSTIC_API_KEY)
  gimme(req.file.path, {}, ({ track, trackVariants }) => {
    unlink(req.file.path, err => {
      if (err)
        throw err
      res.status(200).json({
        track,
        trackVariants: trackVariants.filter(variant => !!variant.title && track.title !== variant.title)
      })
    })
  })
})

export default handler

export const config = {
  api: {
    bodyParser: false
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.