generated from UoaWDCC/react-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from UoaWDCC/Fix/CI-Pipeline
MAKE CI PIPELINE GREAT AGAIN
- Loading branch information
Showing
79 changed files
with
3,198 additions
and
7,634 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,8 +1,7 @@ | ||
name: Build API Client | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, closed] | ||
push | ||
|
||
jobs: | ||
build: | ||
|
@@ -27,5 +26,6 @@ jobs: | |
commit_user_name: "github-api-actions[bot]" | ||
commit_user_email: "github-api-actions[bot]@users.noreply.github.com" | ||
commit_author: Author <[email protected]> | ||
commit_options: '--no-verify' | ||
|
||
|
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,22 @@ | ||
name: Continuous Integration | ||
|
||
# This action works with pull requests and pushes | ||
on: | ||
push | ||
|
||
jobs: | ||
prettier: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
# Make sure the actual branch is checked out when running on pull requests | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Prettify code | ||
uses: creyD/[email protected] | ||
with: | ||
# This part is also where you can pass other options, for example: | ||
commit_message: "Chore: Prettify code" |
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
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
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
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,37 +1,42 @@ | ||
import express from 'express'; | ||
import { initialize } from 'express-openapi'; | ||
import swaggerUi from 'swagger-ui-express'; | ||
import yamljs from 'yamljs'; | ||
|
||
import eventsService from './api/services/eventsService.js'; | ||
import usersService from './api/services/usersService.js'; | ||
import express from "express"; | ||
import { initialize } from "express-openapi"; | ||
import swaggerUi from "swagger-ui-express"; | ||
import yamljs from "yamljs"; | ||
|
||
import eventsService from "./api/services/eventsService.js"; | ||
import usersService from "./api/services/usersService.js"; | ||
|
||
// initialise openapi with express, serving api docs at '/api-docs-json' as json :( | ||
const app = express(); | ||
|
||
// middleware | ||
app.use(express.json()); | ||
|
||
const apiDoc = yamljs.load('./api/api-doc.yml'); | ||
const apiDoc = yamljs.load("./api/api-doc.yml"); | ||
initialize({ | ||
app, | ||
apiDoc: apiDoc, | ||
dependencies: { | ||
eventsService: eventsService, | ||
usersService: usersService | ||
usersService: usersService, | ||
}, | ||
paths: './api/paths', | ||
docsPath: '/api-docs-json', | ||
paths: "./api/paths", | ||
docsPath: "/api-docs-json", | ||
}); | ||
|
||
// convert from json and serve api docs with a pretty ui using swagger-ui :) | ||
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(null, { | ||
swaggerOptions: { | ||
url: '/api-docs-json', | ||
}, | ||
})); | ||
app.use( | ||
"/api-docs", | ||
swaggerUi.serve, | ||
swaggerUi.setup(null, { | ||
swaggerOptions: { | ||
url: "/api-docs-json", | ||
}, | ||
}), | ||
); | ||
|
||
app.listen(3000, () => { | ||
console.log('Server running, API docs available at http://localhost:3000/api-docs'); | ||
console.log( | ||
"Server running, API docs available at http://localhost:3000/api-docs", | ||
); | ||
}); |
Oops, something went wrong.