Skip to content

Commit 88cc96b

Browse files
jonocrbuddhajjigaexkevinparkwilliamdyoonMadinventorZero
committed
Added router for sandabox
Co-authored-by: buddhajjigae <[email protected]> Co-authored-by: xkevinpark <[email protected]> Co-authored-by: williamdyoon <[email protected]> Co-authored-by: MadinventorZero <[email protected]>
1 parent 0faacf5 commit 88cc96b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

server/server.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ const isTest = process.env.NODE_ENV === 'test';
1919
app.use(express.json());
2020
app.use(cookieParser());
2121

22+
23+
// Routes
24+
const stylesRouter = require('./routers/stylesRouter');
25+
2226
// enable cors
2327
// options: origin: allows from localhost when in dev or the app://rse when using prod, credentials: allows credentials header from origin (needed to send cookies)
2428
app.use(
@@ -71,8 +75,15 @@ const resolvers = {
7175
Mutation,
7276
};
7377

78+
app.use('/demoRender', express.static(path.join(__dirname, '../app/src/components/main/renderDemo.css')));
79+
80+
81+
// Re-direct to route handlers:
82+
app.use('/user-styles', stylesRouter);
83+
7484
// schemas used for graphQL
7585
const typeDefs = require('./graphQL/schema/typeDefs.js');
86+
// const { dirname } = require('node:path');
7687

7788
// instantiate Apollo server and attach to Express server, mounted at 'http://localhost:PORT/graphql'
7889
const server = new ApolloServer({ typeDefs, resolvers });

0 commit comments

Comments
 (0)