Giter Site home page Giter Site logo

free-alpaca-43's Introduction

Deno KV Template

This application is a starter template that uses Fresh and Deno KV for persistence. Check out a live demo here! Learn more about building web applications with Fresh, and about interacting with Deno KV to store data.

Running locally

To run this application locally, ensure the Deno runtime is installed first. In the folder where you cloned this app, run this command:

deno task start

This will start the Fresh server, as configured in deno.json at the root of this project. Your project will be monitored for changes, and restart if necessary.

Running on Deno Deploy

To run this project in production, you will need access to the Deno KV private beta on Deno Deploy. Once you have access to Deno KV on Deploy, you can deploy this project like any other - you can deploy using a GitHub integration if your app is pushed up to GitHub, or you can deploy from the CLI using deployctl and the commands below.

# Install the "deployctl" command line tool
deno install --allow-all --no-check -r -f https://deno.land/x/deploy/deployctl.ts

# Store your personal access token in a DENO_DEPLOY_TOKEN environment variable
# Create a token at https://dash.deno.com/account#access-tokens
export DENO_DEPLOY_TOKEN=ddp_Nxxxxxxxxx

# Deploy to a project created at https://dash.deno.com
deployctl deploy --project=<your project name here> --prod main.ts

A quick project overview

This template is a lightly modified version of the default Deno Fresh application template. It displays a simple counter that is persisted by Deno KV. Here's where to find a few key parts of this Fresh application:

  • utils/db.ts - opens a Deno KV data store and handles updating a count property
  • routes/index.tsx - Handles and renders server-side a request to the home page
  • routes/api/count.ts - a route that handles an HTTP POST request to update the count
  • islands/Counter.tsx - a client-side island that handles user interaction in the browser

To learn more about how your Fresh project works, check out the Fresh manual.

License

MIT

free-alpaca-43's People

Contributors

iuioiua avatar kwhinnery avatar

Watchers

 avatar  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.