Toggle navigation
Toggle navigation
This project
Loading...
Sign in
DongyoungKwon
/
Teleprompter-SST
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
DongyoungKwon
2020-12-07 20:30:31 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8d31292d342c13e1f54bfce1c6ee0df0fc8cf83f
8d31292d
1 parent
4404b612
Modify for distribution using heroku
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
client/src/components/Teleprompter.js
package.json
server.js
client/src/components/Teleprompter.js
View file @
8d31292
...
...
@@ -3,9 +3,9 @@ import styled from 'styled-components'
import
stringSimilarity
from
'string-similarity'
const
StyledTeleprompter
=
styled
.
div
`
font-size:
9
rem;
font-size:
6
rem;
width: 100%;
height:
56
rem;
height:
35
rem;
scroll-behavior: smooth;
overflow: auto;
display: block;
...
...
package.json
View file @
8d31292
{
"name"
:
"teleprompter-s
s
t"
,
"name"
:
"teleprompter-s
t
t"
,
"version"
:
"1.0.0"
,
"description"
:
""
,
"main"
:
"index.js"
,
"scripts"
:
{
"heroku-postbuild"
:
"NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
,
"client"
:
"cd client && yarn start"
,
"server"
:
"nodemon server.js"
,
"dev"
:
"concurrently --kill-others-on-fail
\"
yarn server
\"
\"
yarn client
\"
"
...
...
@@ -21,5 +22,9 @@
"devDependencies"
:
{
"concurrently"
:
"^5.3.0"
,
"nodemon"
:
"^2.0.6"
},
"engines"
:
{
"node"
:
"12.18.3"
,
"npm"
:
"6.14.6"
}
}
...
...
server.js
View file @
8d31292
const
fs
=
require
(
'fs'
);
const
path
=
require
(
"path"
);
const
express
=
require
(
'express'
);
const
bodyParser
=
require
(
'body-parser'
);
const
app
=
express
();
...
...
@@ -19,4 +20,10 @@ app.post('/api/:script', (req, res) => {
scriptReceived
=
req
.
body
.
script
;
});
app
.
use
(
express
.
static
(
path
.
join
(
__dirname
,
'./client/build'
)));
// μ μ νμΌλ‘ λ°κΏμ§ React[front-end]λ₯Ό Express μλ²λ‘ μ¬μ©νμ¬ κΈ°μ‘΄μ 2κ°μ μλ²λ‘ μ΄μνλ κ²μ νλμ μλ²λ‘ μ¬μ©ν μ μλλ‘ ν΄μ€
app
.
get
(
'*'
,
(
req
,
res
,
next
)
=>
{
res
.
sendFile
(
path
.
join
(
__dirname
,
"./client/build"
,
"index.html"
));
});
app
.
listen
(
port
,
()
=>
console
.
log
(
`Listening on port
${
port
}
`
));
\ No newline at end of file
...
...
Please
register
or
login
to post a comment