The best way to do this is to configure apache to proxy api.mywebsite.com to port 3001 on your server
grepped the following example from
<VirtualHost *:*>
ProxyPreserveHost On
ProxyPass "/" "http://localhost:3001/"
ProxyPassReverse "/" "http://localhost:3001/"
ServerName api.mywebsite.com
</VirtualHost>
https://httpd.apache.org/docs/2.4/vhosts/examples.html
please ensure you you also use the right CORS settings else you wont be able to request your api from yourwebsite frontend
A different way to prevent this is just to proxy the location /api to your api
<Location "/api/">
ProxyPass "http://localhost:3001"
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
</Location>
https://httpd.apache.org/docs/2.4/mod/mod_proxy.html