1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-11 03:34:35 +00:00

chore: server issue fix

This commit is contained in:
Saad Jutt
2021-11-10 08:33:44 +05:00
parent 652af82dac
commit 98ef40ffd6
3 changed files with 18 additions and 21 deletions

View File

@@ -4,8 +4,8 @@ import * as https from 'https'
import { configuration } from '../package.json' import { configuration } from '../package.json'
import app from './app' import app from './app'
const keyPath = path.join('certificates', 'privkey.pem') const keyPath = path.join('..', 'certificates', 'privkey.pem')
const certPath = path.join('certificates', 'fullchain.pem') const certPath = path.join('..', 'certificates', 'fullchain.pem')
const key = readFileSync(keyPath) const key = readFileSync(keyPath)
const cert = readFileSync(certPath) const cert = readFileSync(certPath)

View File

@@ -3,6 +3,8 @@
"version": "0.0.1", "version": "0.0.1",
"description": "NodeJS wrapper for calling the SAS binary executable", "description": "NodeJS wrapper for calling the SAS binary executable",
"scripts": { "scripts": {
"server:install": "cd web && npm ci && cd ../api && npm ci",
"server": "cd web && npm run build && cd ../api && npm run start:prod",
"lint-api:fix": "npx prettier --write \"api/src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"", "lint-api:fix": "npx prettier --write \"api/src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"",
"lint-api": "npx prettier --check \"api/src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"", "lint-api": "npx prettier --check \"api/src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"",
"lint-web:fix": "npx prettier --write \"web/src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"", "lint-web:fix": "npx prettier --write \"web/src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"",

View File

@@ -1,30 +1,25 @@
import axios from 'axios'
import React, { useState } from 'react' import React, { useState } from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { CssBaseline, Box, TextField, Button } from '@mui/material' import { CssBaseline, Box, TextField, Button } from '@mui/material'
const getAuthCode = async (credentials: any) => { const getAuthCode = async (credentials: any) => {
return axios return fetch('/SASjsApi/auth/authorize', {
.post('/SASjsApi/auth/authorize', { method: 'POST',
method: 'POST', headers: {
headers: { 'Content-Type': 'application/json'
'Content-Type': 'application/json' },
}, body: JSON.stringify(credentials)
body: JSON.stringify(credentials) }).then((data) => data.json())
})
.then((data: any) => data.json())
} }
const getTokens = async (payload: any) => { const getTokens = async (payload: any) => {
return axios return fetch('/SASjsApi/auth/token', {
.post('/SASjsApi/auth/token', { method: 'POST',
method: 'POST', headers: {
headers: { 'Content-Type': 'application/json'
'Content-Type': 'application/json' },
}, body: JSON.stringify(payload)
body: JSON.stringify(payload) }).then((data) => data.json())
})
.then((data: any) => data.json())
} }
const Login = ({ setTokens }: any) => { const Login = ({ setTokens }: any) => {