This file contains hidden or 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 { Request, Response } from "express"; | |
class UserController { | |
static check = async(req:Request,res:Response) => { | |
res.send("You're authorized!"); | |
} | |
} | |
export default UserController; |
This file contains hidden or 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 { Request, Response } from "express"; | |
import * as jwt from "jsonwebtoken"; | |
import { random } from "../utils/index"; | |
import config from "../config/index"; | |
class AuthController { | |
public static refTokens = new Array<{ username: string, refreshToken: string }>(); | |
private static issueToken = async (username: string) => { | |
const userToken = { | |
username |
This file contains hidden or 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 express from "express"; | |
const app = express(); | |
app.get('/', (req, res) => { | |
res.send("Hello world!"); | |
}); | |
app.listen(3000, () => { | |
console.log(`Server is running in http://localhost:3000`); |
This file contains hidden or 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
public class Student | |
{ | |
public string Name {get; set;} | |
} |
NewerOlder