API

An application programming interface (API) is a set of routines, definitions, and protocols that allow developers to build application software. APIs abstract implementation and expose only necessary objects and actions to the developer.

API subscription active
You will receive email notifications for new publications on API.
675 Results
  • Question

    connect() failed (111: Connection refused) while connecting to upstream

    Hi all, Followed this (https://lengstorf.com/code/deploy-nodejs-ssl-digitalocean/) tutorial to get Let's Encrypt working on my Nest.js/Node server. Everything works - running sudo nginx -t returns: nginx: the configu...
    Accepted Answer: Hello, You can only have 1 service listening on 1 port. So as you have Nginx listening on port 80 at the moment, you can not have your Node on the same port. Also as you currently have your Nginx set to work as a reve...
    11 By hbendixlewis Nginx API Let's Encrypt DigitalOcean Ubuntu 18.04
  • Question

    Caddy server and subdomain point to port not working

    I am hosting my Apollo Graphql api on digital ocean centos 8. I can call the api using http://ip:4000/graphql So now I want to replace with ip to subdomain an point to digital ocean ip from cloudflare. I called https:...
    Accepted Answer: Hi there, Just went through the Caddy documentation and I think that you need to update the Caddyfile to: nginx api.mydomain.com { reverse_proxy /graphql* { to data_api:4000 header_down Access-Control-Allow-...
    1 By alexaung API Docker
  • Question

    How to setup subdomain point to api using ip:port hosted in doker container

    I have nodejs api hosted in docker contain on my centos droplet. I can call using http://ip:4000/graphql. Now I want to point api.mydomain.com/graphql to ip:4000. My domain is point to google cloud. May I know how can...
    Accepted Answer: Hello, You can achieve this with Nginx. You would need to set up an Nginx server block and add a reverse proxy rule. Here is a quick tutorial that demonstrates this: https://www.digitalocean.com/community/questions/ho...
    1 By alexaung API Container Docker GraphQL Node.js
  • Question

    How to get average of CPU stats and load1 Stats Values ( Explained )

    hey, I am trying to understand this For each Droplet, find the stats via Digital Ocean API, such as Load1 metrics https://docs.digitalocean.com/reference/api/api-reference/#operation/getdropletbandwidth_metrics (http:...
    Accepted Answer: Hello, You can calculate the average by summing up the values in the metric field based on the mode that you are after. The exact syntax would depend on what framework or programming language you are using. The respon...
    1 By coderaliraza API Building on DigitalOcean
  • Question

    How can i point subdomain to ip:port?

    Hello, how can i point several subdomains to ip:port, for example api.domain.com -> 22.333.33.222:3000 app.domain.com -> 22.333.33.222:3001
    Accepted Answer: Hi @klapovsciuk, You can redirect your domain to a certain port. This depends on the WebService you are using -Nginx/Apache. If you are using Nginx, you'll need to do add a server block to your Nginx's website config....
    2 By klapovsciuk API
  • Question

    I want my app to start working with digital ocean and to query around 10k api's in 10-30seconds

    I have an app that queries a lot of APIs, it relies on speed and it needs to be super fast. I want to start running all the processing on the cloud instead of the client-side to make the app faster but I don't know wh...
    Accepted Answer: Hello, I believe that all suggestions have their benefits. What I would personally do is to do it step by step, so first create a backend service that is capable of consuming the APIs and testing it out on a Droplet d...
    1 By benshalev849 API Cloud Computing Kubernetes
  • Question

    Step 5: "sudo: ufw: command not found"

    I'm on Step 5 and am getting the error above when I run the sudo ufw commands. I'm assuming this has something to do with your warning about ports. How do I forward the port from my personal firewall to the port that ...
    Accepted Answer: Hi there @negustaf, If you are going to be running the Slackbot on your Mac and if you already have a local/personal firewall there is no need to install UFW. You would need UFW installed on your server so that you co...
    1 By negustaf Python API Ubuntu 20.04 Slack
  • Question

    [App PLatform] Billing for internal service

    If I create an internal service on the App Platform via the App Spec for my api and a Next ssr component as my frontend, I will be billed for the bandwidth only once right? I realise that the data from the api will be...
    Accepted Answer: Hi there, I believe that it does not. As according to the documentation, only data transfer on the public network interface counts against your bandwidth allowance. https://www.digitalocean.com/docs/billing/bandwidth/...
    1 By thecertnginx DigitalOcean App Platform Next.js API
  • Question

    Rate limit on volume snapshot is too low

    If you have more than one volume and if you wish to snapshot both the volumes at the same time via API its not possible because the rate limit on snapshot is 1 every 10mins
    Accepted Answer: If Your account is not verified then you will face such errors. This is what the DO support team informed me. I can confirm the issue is resolved now.
    2 By thatdevopsguy API
  • Question

    Creating a site on a droplet via the DigitalOcean API

    I have been looking through the documentation and read through all the support and question channels and have yet to find something to point me in the right direction. I wish to be able to create an ngninx entry (in /...
    Accepted Answer: Hi there, The DigitalOcean API lets you manage your infrastructures like server provisioning, creation of Load balancers, clusters and etc. The server configuration itself needs to be done via an automation tool like ...
    1 By weareframework DigitalOcean DigitalOcean API and CLI (doctl) API DigitalOcean Droplets
  • Question

    How to enable the ssl certificate for my droplet IP address

    Hello to all, I have deploying my spring boot rest application in my debian 10 server and I make differents api rest call with http://myipaddress:8080 but the problem is that in my angular web client who differents u...
    Accepted Answer: Hi there @sinclairjaza, I would recommend taking a look at this answer here by ryanpq: https://www.digitalocean.com/community/questions/ssl-for-ip-address He mentions that unfortunately the free LetsEncrypt CA does no...
    1 By sinclairjaza API Apache Debian
  • Question

    Not able to perform graphql queries after changing database to Supabase PostgresQL database

    I followed this tutorial https://www.digitalocean.com/community/tutorials/how-to-build-a-graphql-api-with-prisma-and-deploy-to-digitalocean-s-app-platform#:~:text=Resolver%20functions%20receive,in%20GraphQL%20Resolver...
    Accepted Answer: Hi there, I think that you can not change the connector to supabase:// as it is not a valid connector according to the list with the supported database connectors for Prisma here: https://www.prisma.io/docs/concepts/d...
    1 By sumchans Node.js Git API Development GraphQL DigitalOcean App Platform
  • Question

    Get droplet metric data via the API

    Hello, is there a way to get droplet metric data via the API? I've looked at the API docs page and have not seen such a thing.
    Accepted Answer: Hello, Just a quick update here. DigitalOcean now has a Monitoring API endpoint that you could use. For more information you can take a look at the official API documentation here: https://docs.digitalocean.com/refere...
    2 By RiversideRocks API
  • Question

    How do I fix a 502 bad gateway error combined with a 302 Nginx connection refused error?

    My hosted node app stopped working with a 502 Bad Gateway Error and I noticed 302 connection errors when I typed in sudo tail -30 /var/log/nginx/error.log api = the subdomain I've put the node app on ``` 2021/03/10 21...
    Accepted Answer: Hi there, As far as I can see from the error, the backend service that is supposed to be running on port 3001 is not active. You need to make sure that you start the service so that Nginx could connect to that backend...
    1 By philosophicalrambling Nginx Node.js API
  • Question

    Nginx converts POST request to GET request Laravel

    I have a running a Laravel project on Nginx, every thing works fine except when I want to login via the API, I use Passport for authentication, but when I try to login it returns with 404 and a message "The GET method...
    Accepted Answer: I solved it by adding SSL certification to the server and enabling HTTPS in server configuration.
    2 By abdelnasserahmed96 Nginx Laravel API
  • Question

    Intermittent connection refused with cURL on localhost only

    After updating my droplet running Ubuntu 17.10 a week ago I have been experiencing intermittent "Connection refused" errors when making requests to my API using cURL. After spending hours narrowing down the cause of t...
    Accepted Answer: I'll answer my own question for anyone else having the same issue. After days of trying to figure out what the issue was, a Stack Overflow answer on an unrelated topic pointed me in the right direction. I knew that wh...
    2 By chrisjonesio Networking API Development DNS Ubuntu
  • Question

    I like to start a cloud hosting business using digital ocean platform to provide following following features.

    Last year I started using AWS free 1-year trial to learn how the web server works and what people needs. Since AWS is a bit pricy as compared to the Digital ocean so I decided to move here. And I started learning pyth...
    Accepted Answer: Hello, Most of the things should be achievable with a web hosting billing system like Hostbill (https://www.digitalocean.com/community/tools/hostbill) or WHMCS. According to their official website, HostBill lets you a...
    1 By subarnamoybosebusiness API OpenLiteSpeed WordPress 1-Click Initial Server Setup Nginx Apache Ansible Building on DigitalOcean Business
  • Question

    How to use beanstalkd as worker component for my app ?

    Hello there, We have developed a Lumen REST API. We use beanstalkd for queues on the local workstation. So we decided to use the App Platform for the production stage. We have a service for the Lumen code from Github,...
    Accepted Answer: Hello @castorruffy The beanstalkd can be added as a worker component for queues in general. If there is HTTP routing then only consider it to deploy as a service component. Here's the documentation which might help y...
    1 By castorruffy PHP DigitalOcean App Platform API
  • Question

    Ubuntu 20.04 with .net core api and angular app connection refused

    I have Ubuntu droplet and I was able to set up .net core api app on it to be run as a service. When I do curl -v http://localhost:5000/api/values I get proper ones. I do not need this api to be seen outside of the dro...
    Accepted Answer: Hi there @nosfaratus, This sounds like a problem with Nginx, what I could suggest here is to check a few things first: Make sure Nginx is up and running: command,bash sudo systemctl status nginx Make sure that there ...
    1 By nosfaratus Angular API Nginx Ubuntu 20.04
  • Question

    Setting up a PHP REST API on App Platform without .php extension

    I am trying to set up a PHP REST API on App Platform. The first issue I noticed is that I can't set a URL without the .php extension. Not sure if there's any workaround for this at the moment. I noticed that we have c...
    Accepted Answer: Hi, I am not sure what you mean exactly, PHP app will not work as static site at all as it will serve only your source code, no PHP interpreter there, but if you working with Dynamic Web APP then using .htaccess you c...
    1 By mudora23 DigitalOcean App Platform API