- This enables you to access the vscode over the internet in a single click
- Domain Name (Suggested Google Domains)
- GCP or Azure or AWS Account
- Web server : Nginx
- SSL : Let's encrypt
| #! /bin/sh | |
| # Update the system | |
| sudo apt update | |
| sudo apt upgrade -y | |
| # Install snapd | |
| sudo apt install snapd -y | |
| sudo snap install core |
| FROM golang:1.19.1-alpine3.16 as builder | |
| WORKDIR /app | |
| COPY go.* ./ | |
| RUN go mod download | |
| COPY . ./ | |
| RUN go build -v -o server | |
| FROM alpine:3.16 | |
| COPY --from=builder /app/server /app/server | |
| EXPOSE 8080 | |
| CMD ["/app/server"] |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script> | |
| <title>Document</title> |
| import requests | |
| import json | |
| def getUpdates(): | |
| api = "https://api.telegram.org/bot<token>/getUpdates" | |
| # add headers | |
| headers = {'Content-Type': 'application/json'} | |
| # add body params | |
| data = {'allowed_updates': ['update_id']} | |
| # stringify body params |
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "log" | |
| "os" | |
| "strings" | |
| "time" |
================================
curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run
curl -fsSL https://code-server.dev/install.sh | sh
sudo apt update
sudo systemctl enable --now code-server@$USER
| package main | |
| import ( | |
| "os" | |
| "github.com/gin-contrib/cors" | |
| "github.com/gin-gonic/gin" | |
| "github.com/rahul-yr/learn-go-grapql/graph" | |
| ) |
| package graph | |
| import ( | |
| "net/http" | |
| "github.com/gin-gonic/gin" | |
| "github.com/graphql-go/graphql" | |
| "github.com/rahul-yr/learn-go-grapql/todo" | |
| ) |
| // used as web server | |
| // you could use any web server of your choice such as mux, http, go fiber etc | |
| go get github.com/gin-gonic/gin | |
| // used for handling cors | |
| go get github.com/gin-contrib/cors | |
| // is the actual module for implementing GraphQL Server | |
| go get github.com/graphql-go/graphql |