-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c751b1
commit 71bdd24
Showing
18 changed files
with
493 additions
and
20,011 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
node_modules | ||
dist/ | ||
testPSQL.js | ||
graph | ||
graphQLServer/ | ||
server/graphQLServer/schema.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
services: | ||
- docker | ||
|
||
dist: xenial | ||
|
||
script: | ||
- docker-compose -f docker-compose-test.yml up --abort-on-container-exit | ||
- python3 -VV | ||
- pip -V | ||
|
||
before_deploy: | ||
- python3 -m pip install --upgrade pip | ||
- python3 -m pip install --user awscli | ||
- python3 -m pip install --user awsebcli | ||
- export PATH=$PATH:$HOME/.local/bin | ||
|
||
env: | ||
global: | ||
- PATH=/opt/python/3.7.1/bin:$PATH | ||
|
||
deploy: | ||
provider: script | ||
cleanup: true | ||
on: | ||
branch: main | ||
script: sh $TRAVIS_BUILD_DIR/scripts/deploy.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM node:12.18.3 | ||
WORKDIR /usr/src/app | ||
COPY . . | ||
RUN npm install && npm run build | ||
EXPOSE 3000 | ||
ENTRYPOINT ["node", "./server/server.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM node:12.18.3 | ||
RUN npm install --global jest | ||
WORKDIR /usr/src/app | ||
COPY . /usr/src/app | ||
RUN npm install && npm run build | ||
EXPOSE 3000 | ||
ENTRYPOINT [ "npm", "test" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"AWSEBDockerrunVersion": "1", | ||
"Image": { | ||
"Name": "416156120607.dkr.ecr.us-east-2.amazonaws.com/draqla:<VERSION>", | ||
"Update": "true" | ||
}, | ||
"Ports": [{ | ||
"ContainerPort": "3000" | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
const express = require('express'); | ||
const app = express(); | ||
const path = require('path'); | ||
const router = require('../server/router.js'); | ||
const { graphqlHTTP } = require('express-graphql'); | ||
const schema = require('../server/graphQLServer/schema'); | ||
|
||
|
||
app.use(express.json()); | ||
|
||
/* route handlers */ | ||
app.use('/graphql', | ||
graphqlHTTP({ | ||
schema, | ||
graphiql: true, | ||
}) | ||
); | ||
app.use('/', router); | ||
|
||
/* handles static files */ | ||
app.use('/dist', express.static(path.resolve(__dirname, '../dist'))); | ||
app.use('/assets', express.static(path.resolve(__dirname, '../client/assets'))); | ||
|
||
app.get('/*', (req, res) => { | ||
return res.status(200).sendFile(path.join(__dirname, '../client/index.html')); | ||
}); | ||
|
||
// catch all | ||
app.use('*', (req, res, next) => { | ||
return res.status(404).send('Sorry, wrong page! Try again! 🤪'); | ||
}); | ||
|
||
// global error handler | ||
app.use((err, req, res, next) => { | ||
const defaultErr = { | ||
log: 'Express error handler caught unknown middleware error', | ||
status: 400, | ||
message: { err: 'Interal Server Error' }, | ||
}; | ||
|
||
const errorObj = Object.assign(defaultErr, err); | ||
console.log(errorObj.log); | ||
return res.status(errorObj.status).send(errorObj.message); | ||
}); | ||
|
||
module.exports = app; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: "3.0" | ||
services: | ||
test: | ||
image: draqla/app-test | ||
container_name: 'app-test' | ||
ports: | ||
- "3000:3000" | ||
volumes: | ||
- .:/usr/src/app | ||
- node_modules:/usr/src/app/node_modules | ||
command: npm test | ||
volumes: | ||
node_modules: |
Oops, something went wrong.