Skip to content

Instantly share code, notes, and snippets.

View klogic's full-sized avatar
☀️
Make today better than yesterday.

Narongsak Keawmanee klogic

☀️
Make today better than yesterday.
View GitHub Profile
@klogic
klogic / app.ts
Last active January 29, 2020 02:47
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) => {
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);
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}!`));
@klogic
klogic / app.ts
Created February 16, 2019 02:45
socket-io-playground/app.ts
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) => {
@klogic
klogic / tsconfig.js
Created February 16, 2019 00:28
socket-io-playground/tsconfig.js
{
"compilerOptions": {
"target": "es2017",
"module": "commonjs",
"baseUrl": ".",
"outDir": "./dist",
"jsx": "react",
"strict": true,
"noImplicitAny": true,
"allowSyntheticDefaultImports": true,
@klogic
klogic / package.json
Created February 16, 2019 00:01
socket-io-playground/package.json
{
"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\""
},
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();
import { Request, Response } from 'express';
const hi = (req: Request, res: Response) => {
res.json({ hi: 'hi' });
};
module.exports = 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();
app
{
"compilerOptions": {
"target": "esnext",
"module": "commonjs",
"baseUrl": ".",
"outDir": "dist",
"jsx": "react",
"moduleResolution": "node",
"allowJs": true,
"paths": {