Node.js wrapper in Ionic

I am using woocommerce-api node js wrapper directly in my ionic component for updating the customer profile . Is it a bad coding design should I move the code to separate server.js file?