This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use actix_web::{get, App, HttpServer, Responder}; | |
#[get("/")] | |
async fn index() -> impl Responder { | |
"Hello World!" | |
} | |
#[actix_web::main] | |
async fn main() -> std::io::Result<()> { | |
HttpServer::new(|| App::new().service(index)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"database/sql" | |
"os" | |
"github.com/uptrace/bun" | |
"github.com/uptrace/bun/dialect/pgdialect" | |
"github.com/uptrace/bun/driver/pgdriver" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { env } from "node:process"; | |
import { DataTypes, Sequelize } from "sequelize"; | |
const dbUser = env.dbUser; | |
const dbUserPass = env.dbUserPass; | |
const dbName = env.dbName; | |
const sequelize = new Sequelize( | |
`postgres://${dbUser}:${dbUserPass}@localhost:5432/${dbName}`, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
public class NoUserResponse { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"database/sql" | |
"os" | |
"github.com/uptrace/bun" | |
"github.com/uptrace/bun/dialect/pgdialect" | |
"github.com/uptrace/bun/driver/pgdriver" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demo; | |
public class NoUserResponse { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { env } from "node:process"; | |
import { DataTypes, Sequelize } from "sequelize"; | |
const dbUser = env.dbUser; | |
const dbUserPass = env.dbUserPass; | |
const dbName = env.dbName; | |
const sequelize = new Sequelize( | |
`postgres://${dbUser}:${dbUserPass}@localhost:5432/${dbName}`, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const basePath = "/Users/mayankc/Work/source/perfComparisons"; | |
Bun.serve({ | |
port: 3000, | |
fetch(request) { | |
const fp = basePath + new URL(request.url).pathname; | |
try { | |
return new Response(Bun.file(fp)); | |
} catch (e) { | |
return new Response(null, { status: 404 }); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use actix_web::{get, App, HttpServer, Responder}; | |
use uuid::Uuid; | |
#[get("/")] | |
async fn index() -> impl Responder { | |
return "Hello ".to_owned() + &Uuid::new_v4().to_string(); | |
} | |
#[actix_web::main] | |
async fn main() -> std::io::Result<()> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jwt from "jsonwebtoken"; | |
import { env } from "node:process"; | |
const jwtSecret = env.JWT_SECRET; | |
function getToken(headers) { | |
if ( | |
headers && headers.authorization && | |
headers.authorization.startsWith("Bearer ") | |
) { |
NewerOlder