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 { Response, Request } from "express"; | |
| const kue = require("kue"); | |
| const express = require("express"); | |
| const app = express(); | |
| const port = 3000; | |
| const axios = require("axios"); | |
| const queue = kue.createQueue(); | |
| app.get("/", (req: Request, res: Response) => { |
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 { Response, Request } from "express"; | |
| const kue = require("kue"); | |
| const express = require("express"); | |
| const app = express(); | |
| const port = 3000; | |
| app.get("/", (req: Request, res: Response) => { | |
| res.send("Hello World!"); | |
| }); | |
| app.use("/kue-api/", kue.app); |
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 { Response, Request } from "express"; | |
| const express = require("express"); | |
| const app = express(); | |
| const port = 3000; | |
| app.get("/", (req: Request, res: Response) => res.send("Hello World!")); | |
| app.listen(port, () => console.log(`Example app listening on port ${port}!`)); |
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 axios from 'axios'; | |
| import express, { Request, Response } from 'express'; | |
| import ioserver, { Socket } from 'socket.io'; | |
| import ioclient from 'socket.io-client'; | |
| const app = express(); | |
| const server = require('http').Server(app); | |
| const port = 3000; | |
| const io = ioserver(server); | |
| app.get('/', (req: Request, res: Response) => { |
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
| { | |
| "compilerOptions": { | |
| "target": "es2017", | |
| "module": "commonjs", | |
| "baseUrl": ".", | |
| "outDir": "./dist", | |
| "jsx": "react", | |
| "strict": true, | |
| "noImplicitAny": true, | |
| "allowSyntheticDefaultImports": true, |
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
| { | |
| "name": "socket-io-playground", | |
| "version": "1.0.0", | |
| "main": "index.js", | |
| "repository": "[email protected]:klogic/socket-io-playground.git", | |
| "author": "Narongsak Keawmanee <[email protected]>", | |
| "license": "MIT", | |
| "scripts": { | |
| "dev": "concurrently \"tsc -w\" \"nodemon dist/app.js\"" | |
| }, |
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 * as hi from './controllers/hi'; | |
| var express = require('express'); | |
| const next = require('next'); | |
| const isDev = process.env.NODE_ENV !== 'production'; | |
| const app = next({ isDev }); | |
| const handle = app.getRequestHandler(); | |
| const server = express(); |
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'; | |
| const hi = (req: Request, res: Response) => { | |
| res.json({ hi: 'hi' }); | |
| }; | |
| module.exports = hi; |
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
| var express = require('express'); | |
| const next = require('next'); | |
| const isDev = process.env.NODE_ENV !== 'production'; | |
| const app = next({ isDev }); | |
| const handle = app.getRequestHandler(); | |
| const server = express(); | |
| app |
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
| { | |
| "compilerOptions": { | |
| "target": "esnext", | |
| "module": "commonjs", | |
| "baseUrl": ".", | |
| "outDir": "dist", | |
| "jsx": "react", | |
| "moduleResolution": "node", | |
| "allowJs": true, | |
| "paths": { |