Skip to content

Commit a79b32b

Browse files
committed
revert back to serving from backend
1 parent bcd61c1 commit a79b32b

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ const {
1111
shell,
1212
dialog,
1313
ipcMain,
14-
globalShortcut,
15-
session
14+
globalShortcut
1615
} = require('electron');
1716

1817
// Uncomment below for hot reloading during development

server/models/reactypeModels.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const sessionSchema = new Schema({
5252
});
5353

5454
const projectSchema = new Schema({
55-
name: { type: String, required: true, unique: true },
55+
name: { type: String, required: true },
5656
project: Object,
5757
userId: {
5858
type: Schema.Types.ObjectId,

server/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ app.get(
2727
cookieController.setSSIDCookie,
2828
(req, res) => {
2929
console.log('At the end of github oauth process');
30-
return res.redirect('/');
30+
return res.status(200).redirect('/');
3131
}
3232
);
3333

@@ -39,7 +39,7 @@ app.use(cookieParser());
3939
// statically serve everything in build folder
4040
app.use('/', express.static(path.resolve(__dirname, '../build')));
4141
app.use(
42-
'/images',
42+
'/src/public/images',
4343
express.static(path.resolve(__dirname, '..src/public/images'))
4444
);
4545

src/components/login/SignIn.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ const SignIn: React.FC<LoginInt & RouteComponentProps> = props => {
144144
Sign In
145145
</Button>
146146

147-
<a href="/github">
148-
<img src="/images/githublogin.png" />
147+
<a href="https://localhost:8080/github">
148+
<img src="../src/public/images/githublogin.png" />
149149
</a>
150150
<br></br>
151151
<Grid container>

src/containers/RightContainer.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ interface BottomTabsPropsInt extends PropsInt {
3131
native: boolean;
3232
toggleCodeEdit(): void;
3333
codeReadOnly: boolean;
34+
currentWorkspace: ApplicationStateInt;
3435
}
3536

3637
function saveProject(project: ApplicationStateInt, name: String) {
3738
console.log('Saving project to DB...');
3839
const body = JSON.stringify({ name, project });
3940
console.log('Project name is', name);
40-
fetch('/saveProject', {
41+
fetch('https://localhost:8080/saveProject', {
4142
method: 'POST',
4243
headers: {
4344
'content-type': 'application/json'
@@ -52,7 +53,7 @@ function saveProject(project: ApplicationStateInt, name: String) {
5253

5354
function getProjects() {
5455
console.log("Loading user's projects...");
55-
fetch('/getProjects', {
56+
fetch('https://localhost:8080/getProjects', {
5657
credentials: 'include'
5758
})
5859
.then(res => res.json())
@@ -76,7 +77,7 @@ const RightContainer = (props: BottomTabsPropsInt) => {
7677

7778
const [projectName, setProjectName] = useState('');
7879

79-
const handleChange = e => {
80+
const handleChange = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
8081
let newVal = e.target.value;
8182
setProjectName(newVal);
8283
};

src/helperFunctions/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const sessionIsCreated = (
66
username,
77
password
88
});
9-
const result = fetch('/login', {
9+
const result = fetch('https://localhost:8080/login', {
1010
method: 'POST',
1111
credentials: 'include',
1212
headers: {
@@ -42,7 +42,7 @@ export const newUserIsCreated = (
4242
email,
4343
password
4444
});
45-
const result = fetch('/signup', {
45+
const result = fetch('https://localhost:8080/signup', {
4646
method: 'POST',
4747
credentials: 'include',
4848
headers: {

0 commit comments

Comments
 (0)