Skip to content

Commit

Permalink
fix: get right structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Sembauke committed Dec 14, 2023
1 parent 6a5e466 commit efdf7eb
Show file tree
Hide file tree
Showing 14 changed files with 1,763 additions and 15,381 deletions.
10 changes: 0 additions & 10 deletions apps/top-flex-box-example/.eslintrc.json

This file was deleted.

6 changes: 6 additions & 0 deletions apps/top-flex-box-example/client/.babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
["@babel/preset-env", { "targets": "> 0.25%, not dead" }],
"@babel/preset-react"
]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Sandpack } from "@codesandbox/sandpack-react"

function App() {
return (
<Sandpack
Expand Down
16 changes: 16 additions & 0 deletions apps/top-flex-box-example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>

<head>
<link rel="stylesheet" href="styles.css" />
<title>The Odin Project Flexbox Example</title>
</head>

<body>
<div id="app"></div>
<script crossorigin src="https://unpkg.com/react@17/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"></script>
<script src="bundle.js"></script>
</body>

</html>
16,975 changes: 1,669 additions & 15,306 deletions apps/top-flex-box-example/package-lock.json

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions apps/top-flex-box-example/package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"name": "top-flex-box-example",
"version": "0.1.0",
"private": true,
"name": "top-flexbox-example-one",
"version": "0.0.1",
"description": "Front end project for freeCodeCamp",
"main": "server.js",
"scripts": {
"start": "node server.js",
"build": "rollup -c",
"prepare": "npm run build"
},
"dependencies": {
"@codesandbox/sandpack-react": "^2.10.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build"
"dotenv": "16.0.0",
"express": "4.17.3"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
"devDependencies": {
"@babel/core": "7.23.2",
"@babel/preset-env": "7.23.2",
"@babel/preset-react": "7.22.15",
"@rollup/plugin-babel": "6.0.4",
"@rollup/plugin-commonjs": "23.0.7",
"@rollup/plugin-node-resolve": "15.0.1",
"@rollup/plugin-replace": "5.0.5",
"@rollup/plugin-terser": "0.2.0",
"rollup": "2.79.1"
}
}
1 change: 1 addition & 0 deletions apps/top-flex-box-example/public/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 0 additions & 20 deletions apps/top-flex-box-example/public/index.html

This file was deleted.

4 changes: 4 additions & 0 deletions apps/top-flex-box-example/public/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
body {
margin: 0;
padding: 0;
}
26 changes: 26 additions & 0 deletions apps/top-flex-box-example/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import babel from '@rollup/plugin-babel';
import replace from '@rollup/plugin-replace';
import terser from '@rollup/plugin-terser';

export default {
input: 'client/index.jsx',
output: {
file: 'public/bundle.js',
format: 'iife',
name: 'Client'
},
plugins: [
resolve({ moduleDirectories: ['node_modules'] }),
replace({
preventAssignment: true,
'process.env.NODE_ENV': JSON.stringify('production')
}),
commonjs({
include: /node_modules/
}),
babel({ babelHelpers: 'bundled' }),
terser()
]
};
1 change: 1 addition & 0 deletions apps/top-flex-box-example/sample.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PORT=3000
19 changes: 19 additions & 0 deletions apps/top-flex-box-example/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require('dotenv').config();
const express = require('express');
const app = express();

app.use(express.static('public'));

app.get('', (req, res) => {
res.sendFile(`${process.cwd()}/index.html`);
});

app.get('/status/ping', (req, res) => {
res.send({ msg: 'pong' }).status(200);
});

const portNum = process.env.PORT || 3000;

app.listen(portNum, () => {
console.log(`Listening on port ${portNum}`);
});
9 changes: 0 additions & 9 deletions apps/top-flex-box-example/src/index.css

This file was deleted.

13 changes: 0 additions & 13 deletions apps/top-flex-box-example/src/index.js

This file was deleted.

0 comments on commit efdf7eb

Please sign in to comment.