Skip to content

Instantly share code, notes, and snippets.

import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
import reportWebVitals from "./reportWebVitals";
import {
ApolloClient,
InMemoryCache,
gql,
ApolloProvider,
interface myUser {
name: string;
age?: number;
birthday?: string;
}
const prettyPrintWilder = (users : myUser[]) => {
console.log("########################");
users.map((el : myUser) => {
@cleroy117
cleroy117 / app.js
Created January 20, 2021 10:59 — forked from fidelisrafael/app.js
Easy way to export data to XLS format using Node.js
// clone this gist to a empty folder, the run:
// npm init (and follow steps)
// npm install express --save
// npm install swig --save
// node app.js and open http://localhost:3000
function App() {
var express = require('express');
const express = require("express");
const router = express.Router();
router.get(
"/superMiddleware",
function (req, res, next) {
s;
console.log("hello middleware");
next();
const express = require("express");
const connection = require("./config");
const app = express();
const port = 3050;
app.listen(port, (err) => {
if (err) {
throw new Error("Something bad happen");
}
mysql> SELECT w.lastname, w.firstname, p.role, t.name
FROM wizard w
JOIN player p ON w.id=p.wizard_id
JOIN team t ON t.id=p.team_id
ORDER BY t.name, p.role, w.lastname, w.firstname;
+-----------------+-------------+--------+------------+
| lastname | firstname | role | name |
+-----------------+-------------+--------+------------+
| Black | Sirius | beater | Gryffindor |
| Brown | Lavender | beater | Gryffindor |
const connection = require("./config");
const express = require("express");
const port = 6667;
const app = express();
app.use(express.json());
connection.then((connection) => {
console.log(`connected on database as id ${connection.threadId}`);
app.get("/", (req, res) => {
const connection = require("./config");
const express = require("express");
const port = 6667;
const app = express();
app.use(express.json());
connection.then((connection) => {
app.get("/", (req, res) => {
res.send("Welcome to my favorite movie lists !!!");
connection
/*connection.query ne fonctionne pas :/
Vu avec Pierre : j'utilise du coup connection.execute.then
Avec cette méthode,
je ne traite pas les cas où l'on a une erreur et
on retourne un status(400).send('erreur')
Bisou
----------------------------------------------------------------
*/
const connection = require("./config");
const connection = require("./config");
const express = require("express");
const port = 3005;
const app = express();
connection.then((connection) => {
app.get("/", (req, res) => {
res.send("Welcome to my favorite movie lists !!!");
connection
.execute("SELECT * FROM movies")