Giter VIP home page Giter VIP logo

medium's Introduction

initialise the backend folder

 npm create hono@latest
Need to install the following packages:
[email protected]
Ok to proceed? (y) y


> npx
> create-hono

create-hono version 0.9.2
? Target directory backend
? Which template do you want to use? cloudflare-workers
✔ Cloning the template
? Do you want to install project dependencies? yes
? Which package manager do you want to use? npm
✔ Installing project dependencies
🎉 Copied project files
Get started with: cd backend

initialise the routes with appropriate methods

app.get("/", (c) => {
  return c.text("Hello Hono!");
});

app.post("/api/v1/user/signup", (c) => {
  return c.text("Hello Hono!");
});
app.post("/api/v1/user/signin", (c) => {
  return c.text("Hello Hono!");
});
app.post("/api/v1/blog", (c) => {
  return c.text("Hello Hono!");
});
app.put("/api/v1/blog", (c) => {
  return c.text("Hello Hono!");
});
app.get("/api/v1/blog/:id", (c) => {
  return c.text("Hello Hono!");
});
app.get("/api/v1/blog/bulk", (c) => {
  return c.text("Hello Hono!");
});
app.get("/api/v1/blog", (c) => {
  return c.text("Hello Hono from blog!");
});

to run the application

npm run dev

initialise prisma

npm i prisma
npx prisma init

cli will use .env file to connect to database, put database url in .env file backend utilise wrangler.toml to connect to database, prisma url in it

initialise the schema

migrate the database->

npx prisma migrate dev --name init_schema

generate prisma client->

npx prisma generate --no-engine

add the accelerate engine ->

npm install @prisma/extension-accelerate

initialise the prisma client

do the code generation

see we did the code in backend

now create a common folder

npm init -y
npx tsc --init

medium's People

Contributors

nalindalal avatar

Watchers

 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.