Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #177 from iterative/use-websites-server
Browse files Browse the repository at this point in the history
  • Loading branch information
yathomasi authored Oct 17, 2022
2 parents 2d3313e + ea602ea commit 578d614
Show file tree
Hide file tree
Showing 13 changed files with 525 additions and 284 deletions.
9 changes: 8 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
require('dotenv').config()
const path = require('path')

const apiMiddleware = require('@dvcorg/websites-server/src/middleware/api')
const redirectsMiddleware = require('@dvcorg/websites-server/src/middleware/redirects')

const siteMetadata = {
title: 'MLEM - Machine Learning Engineering Management',
description: 'Open-source tool to simplify ML model deployment',
Expand Down Expand Up @@ -115,5 +118,9 @@ module.exports = {
: true
},
plugins,
siteMetadata
siteMetadata,
developMiddleware: app => {
app.use(redirectsMiddleware)
app.use('/api', apiMiddleware)
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"build": "gatsby build",
"develop": "gatsby develop",
"dev": "gatsby develop",
"start": "node ./src/server/index.js",
"heroku-postbuild": "./scripts/heroku-deploy.sh",
"start": "node ./src/server.js",
"heroku-postbuild": "heroku-deploy",
"serve": "gatsby serve",
"clean": "gatsby clean",
"format": "prettier --write \"**/*.{js,json,css,md}\"",
Expand All @@ -22,6 +22,7 @@
},
"dependencies": {
"@dvcorg/gatsby-theme-iterative": "0.1.16",
"@dvcorg/websites-server": "^0.0.10",
"@octokit/graphql": "5.0.1",
"@sentry/gatsby": "^7.13.0",
"@svgr/webpack": "6.3.1",
Expand Down
84 changes: 0 additions & 84 deletions scripts/clear-cloudflare-cache.js

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/heroku-deploy.sh

This file was deleted.

12 changes: 12 additions & 0 deletions src/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const server = require('@dvcorg/websites-server')

const app = server.app

// we can also extend to add further custom routes
app.get('/api/status', (req, res) => {
res.send('ok')
})

// run the server
server.run()
32 changes: 0 additions & 32 deletions src/server/index.js

This file was deleted.

65 changes: 0 additions & 65 deletions src/server/middleware/api/github.js

This file was deleted.

7 changes: 0 additions & 7 deletions src/server/middleware/api/index.js

This file was deleted.

43 changes: 0 additions & 43 deletions src/server/middleware/redirects/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions src/server/middleware/serve/index.js

This file was deleted.

30 changes: 0 additions & 30 deletions src/server/middleware/serve/local.js

This file was deleted.

1 change: 0 additions & 1 deletion src/server/utils.js

This file was deleted.

Loading

0 comments on commit 578d614

Please sign in to comment.