Create event with API and load event details

This commit is contained in:
Ben Grant 2021-03-03 15:37:27 +11:00
parent 855477570f
commit 8e5954e0ca
19 changed files with 349 additions and 58 deletions

View file

@ -2,6 +2,7 @@ require('dotenv').config();
const { Datastore } = require('@google-cloud/datastore');
const express = require('express');
const cors = require('cors');
const package = require('./package.json');
@ -20,6 +21,9 @@ const datastore = new Datastore({
keyFilename: process.env.GOOGLE_APPLICATION_CREDENTIALS,
});
app.use(cors({
origin: 'http://localhost:3000',
}));
app.use(express.json());
app.use((req, res, next) => {
req.datastore = datastore;