GithubHelp home page GithubHelp logo

isabella232 / sample-laravel-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from digitalocean/sample-laravel-api

0.0 0.0 0.0 175 KB

⛵ App Platform sample Laravel API application.

Home Page: https://cloud.digitalocean.com/apps

PHP 95.85% Shell 0.89% Blade 3.26%

sample-laravel-api's Introduction

Getting Started

These steps will get this sample Laravel API running for you using DigitalOcean.

Note: Following these steps will result in charges for the use of DigitalOcean services

You can view the following API routes:

  1. Get all posts: GET /api/posts
  2. Create a post: POST /api/posts
  3. Get a single post: GET /api/posts/{postId}
  4. Update a post: PUT/PATCH /api/posts/{postId}
  5. Delete a post: DELETE /api/posts/{postId}

Requirements

You need a DigitalOcean account. If you don't already have one, you can sign up at https://cloud.digitalocean.com/registrations/new

Forking the Sample App Source Code

To use all the features of App Platform, you need to be running against your own copy of this application. To make a copy, click the Fork button above and follow the on-screen instructions. In this case, you'll be forking this repo as a starting point for your own app (see Github documentation to learn more about forking repos.

After forking the repo, you should now be viewing this README in your own github org (e.g. https://github.com/<your-org>/sample-laravel-api)

Deploying the App

Deploy to DO

You can use the Deploy to DigitalOcean button to deploy this repo directly to App Platform.

Deploying the App Manually

  1. Visit https://cloud.digitalocean.com/apps (if you're not logged in, you may see an error message. Visit https://cloud.digitalocean.com/login directly and authenticate, then try again)
  2. Click "Launch App" or "Create App"
  3. Choose GitHub and authenticate with your GitHub credentials.
  4. Under Repository, choose this repository (e.g. <your-org>/sample-laravel-api)
  5. On the Builds screen, add php artisan migrate to the Build Command. Leave the Run Command
  6. Click "Launch App"
  7. You should see a "Building..." progress indicator. And you can click "Deployments"→"Details" to see more details of the build.
  8. It can currently take 5-6 minutes to build this app, so please be patient. Live build logs are coming soon to provide much more feedback during deployments.
  9. Add a Database. Go to Components -> Create Component
  10. Look through .env.example and add the relevant ones to your environment variables. Required are APP_NAME, APP_ENV, APP_KEY
  11. Once you have your database credentials, add them to your environment variables as DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, DB_PASSWORD
  12. Once the build completes successfully, click the "Live App" link in the header and you should see your running application in a new tab

Making Changes to Your App

As long as you left the default Autodeploy option enabled when you first launched this app, you can now make code changes and see them automatically reflected in your live application. During these automatic deployments, your application will never pause or stop serving request because the App Platform offers zero-downtime deployments.

Learn More

You can learn more about the App Platform and how to manage and update your application at https://www.digitalocean.com/docs/apps/.

Deleting the App

When you no longer need this sample application running live, you can delete it by following these steps:

Visit the Apps control panel at https://cloud.digitalocean.com/apps Navigate to the sample-react app Choose "Settings"->"Destroy" This will delete the app and destroy any underlying DigitalOcean resources

Note: If you don't delete your app, charges for the use of DigitalOcean services will continue to accrue.

sample-laravel-api's People

Contributors

keladhruv avatar

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.