Revert "Revert "Add publishing date (#107)" (#108)" (#109)

This reverts commit b1da0b547e.
This commit is contained in:
Niklas Fondberg
2022-03-14 09:56:21 +01:00
committed by GitHub
parent b1da0b547e
commit 1afebfdfdb
8 changed files with 4166 additions and 4051 deletions
+24 -14
View File
@@ -1,4 +1,4 @@
require('newrelic');
const newrelic = require('newrelic');
import dotenv from 'dotenv';
dotenv.config();
@@ -90,20 +90,30 @@ const context = async ({ req }) => {
};
async function main() {
const server = new ApolloServer({
typeDefs,
resolvers,
dataSources,
context,
introspection: true,
plugins: [newRelicPlugin],
});
try {
const server = new ApolloServer({
typeDefs,
resolvers,
dataSources,
context,
introspection: true,
plugins: [newRelicPlugin],
formatError: (err) => {
console.log('Error (fmt):', err);
newrelic.noticeError(err);
return err;
},
});
await server.listen();
await server.listen();
console.log(
'Server is running on http://localhost:4000, ',
process.env.ENVIRONMENT_NAME,
);
console.log(
'Server is running on http://localhost:4000, ',
process.env.ENVIRONMENT_NAME,
);
} catch (ex) {
newrelic.noticeError(ex);
console.error('Got terminal exception:', ex);
}
}
main();