Skip to main content

Posts

Showing posts with the label reactjs

gamer's interview

This project simulates a gamer's interview. Based on NodeJS+ ReactJS The setting is interviewing a gamer/journalist what's his/her plan of March 2020? The gamer answers his/her game list in plan, how many reviews on demand and how many hours expected. Games selected for review take 5 hours for each, while others take one. This project is designed to practice render html, jsx, component, props introduced in  https://www.w3schools.com/REACT/default.asp . Also fixed other issues to make it work. When trying to modualize objects and tools, my design developed to separate views and processes. And it is quite similar to the initialized structure NodeJS+ReactJS provided. Furthermore, since include local module files are banned by browsers, use NodeJS service seems to be the best option. view file main process object tool

No pain no gain.

Local RestJS didn't go much further after I tried to modualize OO design; browser blocks local request: "Cross origin requests are only supported for protocol schemes: http, data, chrome" CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome- extension, https. Then I tried to launch NodeJS service to solve this problem, NodeJS treated all local included files as server main page. Maybe I can tried to use URL requests to mimic the file structure of a general server, but, under asynchronous structure, NodeJS may not process loading files in the same order of usage. Furthermore, when I implemented OO design, it is about the same structure tutorial provided: noteJS, html frame(public/html), main process (src/index.js), and classes(src/module files) Alright..... I surrender. Move back to NodeJS-ReactJS single page app.

First try on embed GitHub

It is not a bad thing to learn some more closely related topics together. But as a beginner(am I?), keeping things simple and clear is important. I searched around tutorials. It seems that almost all tutorials bind NodeJS service firmly as ReactJS's environment. BUT............. .js is supposed to be a client side tool, right? Node is different. Node is an interpreter with post-fix .exe, though it processes JavaScript code, accepts commands in run-time and executes asynchronously. I looked for someway to get rid of npm app's tedious repository. This sample seems to be a good start. Let's see how far I can go. (Probably would stop at using database. At least, I can keep my directory clean before then.) I knew nodejs service is convenient and powerful, comparing to MS Server or Apache . But why should I succumb to something I don't need for now, and let it hinder my way? Just keep it simple.