Skip to content
This repository has been archived by the owner on Feb 3, 2022. It is now read-only.

Commit

Permalink
Added Workflow for Backend
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindsaver committed Mar 12, 2021
1 parent c3d8014 commit 79a62eb
Show file tree
Hide file tree
Showing 8 changed files with 1,241 additions and 61 deletions.
117 changes: 75 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,81 @@
name: ci

on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

jobs:
ci:
runs-on: ${{ matrix.os }}
env:
working-directory: ./frontend

strategy:
matrix:
os: [ubuntu-latest]
node: [14]

steps:
- name: Checkout 🛎
uses: actions/checkout@master

- name: Setup node env 🏗
uses: actions/setup-node@v2.1.5
with:
node-version: ${{ matrix.node }}

- name: Cache node_modules 📦
uses: actions/cache@v2.1.4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies 👨🏻‍💻
run: npm ci
working-directory: ${{env.working-directory}}

- name: Run linter 👀
run: npm run lint
working-directory: ${{env.working-directory}}
frontend:
runs-on: ${{ matrix.os }}
env:
working-directory: ./frontend

strategy:
matrix:
os: [ubuntu-latest]
node: [14]

steps:
- name: Checkout 🛎
uses: actions/checkout@master

- name: Setup node env 🏗
uses: actions/setup-node@v2.1.5
with:
node-version: ${{ matrix.node }}

- name: Cache node_modules 📦
uses: actions/cache@v2.1.4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies 👨🏻‍💻
run: npm ci
working-directory: ${{env.working-directory}}

- name: Run linter 👀
run: npm run lint
working-directory: ${{env.working-directory}}
backend:
runs-on: ${{ matrix.os }}
env:
working-directory: ./backend

strategy:
matrix:
os: [ubuntu-latest]
node: [14]

steps:
- name: Checkout 🛎
uses: actions/checkout@master

- name: Setup node env 🏗
uses: actions/setup-node@v2.1.5
with:
node-version: ${{ matrix.node }}

- name: Cache node_modules 📦
uses: actions/cache@v2.1.4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies 👨🏻‍💻
run: npm ci
working-directory: ${{env.working-directory}}

- name: Run linter 👀
run: npm run lint
working-directory: ${{env.working-directory}}
14 changes: 14 additions & 0 deletions backend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
parserOptions: {
parser: 'babel-eslint',
},
extends: ['prettier', 'plugin:prettier/recommended'],
plugins: ['prettier'],
// add your custom rules here
rules: {},
}
90 changes: 90 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
/logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# Nuxt generate
dist

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

# IDE / Editor
.idea

# Service worker
sw.*

# macOS
.DS_Store

# Vim swap files
*.swp
4 changes: 4 additions & 0 deletions backend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"semi": false,
"singleQuote": true
}
24 changes: 12 additions & 12 deletions backend/app.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var express = require('express')
var path = require('path')
var cookieParser = require('cookie-parser')
var logger = require('morgan')

var authRouter = require('./routes/auth');
var authRouter = require('./routes/auth')

var app = express();
var app = express()

app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(logger('dev'))
app.use(express.json())
app.use(express.urlencoded({ extended: false }))
app.use(cookieParser())

app.use('/api/auth', authRouter);
app.use('/api/auth', authRouter)

module.exports = app;
module.exports = app

0 comments on commit 79a62eb

Please sign in to comment.