Skip to content

Instantly share code, notes, and snippets.

@YonatanKra
Created October 17, 2020 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YonatanKra/0f37862fafd277f517ccdf7a3b593e57 to your computer and use it in GitHub Desktop.
Save YonatanKra/0f37862fafd277f517ccdf7a3b593e57 to your computer and use it in GitHub Desktop.
An express server without AskQL
import express from 'express';
import bodyParser from 'body-parser';
import {logRequestMiddleware, logResultsMiddleware, logError} from "./logger/logger.js";
const port = 8080;
const app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.static('public'));
app.post('/ask', [logRequestMiddleware, logResultsMiddleware, logError]);
app.listen(port, () => {
console.log(`Server listening at http://localhost:${port}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment