Skip to content

Instantly share code, notes, and snippets.

@tim-rohrer
Created June 16, 2020 21:04
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 tim-rohrer/8697218e6d05d59625352959411dbc50 to your computer and use it in GitHub Desktop.
Save tim-rohrer/8697218e6d05d59625352959411dbc50 to your computer and use it in GitHub Desktop.
My express app
import express from 'express';
import FetchGoogleRoutes, { FetchRoutesParams } from './FetchGoogleRoutes';
import { Client } from '@googlemaps/google-maps-services-js';
class App {
public express: express.Application;
public fetch: FetchGoogleRoutes;
constructor() {
this.express = express();
this.fetch = new FetchGoogleRoutes(new Client());
this.mountRoutes();
}
private mountRoutes(): void {
const router = express.Router();
router.post('/fetch', (req, res) => {
console.log(req.body)
res.send("WTF???");
});
this.express.use('/api', router);
this.express.use(express.json());
}
}
export default new App().express;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment