Spaces:
Sleeping
Sleeping
back y frond separados
Browse files- Dockerfile +13 -3
- back/main.js +20 -0
- back/package.json +18 -0
- .gitignore β frond/.gitignore +0 -0
- eslint.config.js β frond/eslint.config.js +0 -0
- index.html β frond/index.html +0 -0
- package.json β frond/package.json +0 -0
- {public β frond/public}/vite.svg +0 -0
- {src β frond/src}/contacts.js +0 -0
- {src β frond/src}/error-page.jsx +0 -0
- {src β frond/src}/index.css +0 -0
- {src β frond/src}/main.jsx +0 -0
- {src β frond/src}/providers/AuthProvider.jsx +0 -0
- {src β frond/src}/routes/contact.jsx +0 -0
- {src β frond/src}/routes/destroy.jsx +0 -0
- {src β frond/src}/routes/edit.jsx +0 -0
- {src β frond/src}/routes/index.jsx +0 -0
- {src β frond/src}/routes/root.jsx +0 -0
- vite.config.js β frond/vite.config.js +0 -0
- mocos.js +0 -8
- package-lock.json +0 -0
Dockerfile
CHANGED
@@ -25,17 +25,27 @@ RUN rm -rf /var/lib/apt/lists/*
|
|
25 |
#RUN chmod +x entrypoint.sh
|
26 |
EXPOSE 7860
|
27 |
#EXPOSE 22
|
28 |
-
RUN ls
|
29 |
|
30 |
RUN node -v
|
31 |
RUN npm -v
|
32 |
|
33 |
-
COPY
|
|
|
34 |
WORKDIR app
|
|
|
|
|
|
|
|
|
35 |
RUN npm install
|
36 |
RUN npm run build
|
|
|
|
|
|
|
|
|
|
|
37 |
# RUN cd /dist/. /var/etc/html
|
38 |
#USER root
|
39 |
#RUN cat /etc/passwd
|
40 |
#ENTRYPOINT ["./entrypoint.sh"]
|
41 |
-
|
|
|
|
25 |
#RUN chmod +x entrypoint.sh
|
26 |
EXPOSE 7860
|
27 |
#EXPOSE 22
|
|
|
28 |
|
29 |
RUN node -v
|
30 |
RUN npm -v
|
31 |
|
32 |
+
COPY ./back ./app-backend
|
33 |
+
COPY ./frond ./app-frond
|
34 |
WORKDIR app
|
35 |
+
RUN ls
|
36 |
+
|
37 |
+
RUN cd ./app-frond
|
38 |
+
RUN ls
|
39 |
RUN npm install
|
40 |
RUN npm run build
|
41 |
+
|
42 |
+
RUN cd ../app-backend
|
43 |
+
RUN ls
|
44 |
+
RUN npm install
|
45 |
+
|
46 |
# RUN cd /dist/. /var/etc/html
|
47 |
#USER root
|
48 |
#RUN cat /etc/passwd
|
49 |
#ENTRYPOINT ["./entrypoint.sh"]
|
50 |
+
#RUN cp ./dist /var/www/html
|
51 |
+
CMD ["npm", "start"]
|
back/main.js
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
let express = require("express");
|
2 |
+
let bodyParser = require("body-parser");
|
3 |
+
const res = require("express/lib/response");
|
4 |
+
const req = require("express/lib/request");
|
5 |
+
let app = express();
|
6 |
+
|
7 |
+
const PORT = process.env.PORT || 7860;
|
8 |
+
|
9 |
+
// Uso middleware
|
10 |
+
app.use("/public", express.static(`${__dirname}/../app-frond/dist/public`));
|
11 |
+
app.use(bodyParser.urlencoded({ extended: false }));
|
12 |
+
|
13 |
+
// Endpoints
|
14 |
+
app.get("/", (req, res) => {
|
15 |
+
res.sendFile(`${__dirname}/../app-frond/dist/index.html`);
|
16 |
+
});
|
17 |
+
|
18 |
+
app.listen(PORT, () => {
|
19 |
+
console.log("La aplicacion esta corriendo");
|
20 |
+
});
|
back/package.json
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "back",
|
3 |
+
"version": "1.0.0",
|
4 |
+
"main": "main.js",
|
5 |
+
"scripts": {
|
6 |
+
"start": "node main.js",
|
7 |
+
"test": "echo \"Error: no test specified\" && exit 1"
|
8 |
+
},
|
9 |
+
"keywords": [],
|
10 |
+
"author": "",
|
11 |
+
"license": "ISC",
|
12 |
+
"description": "",
|
13 |
+
"dependencies": {
|
14 |
+
"express": "^4.19.2",
|
15 |
+
"body-parser": "^1.15.2",
|
16 |
+
"cookie-parser": "^1.4.3"
|
17 |
+
}
|
18 |
+
}
|
.gitignore β frond/.gitignore
RENAMED
File without changes
|
eslint.config.js β frond/eslint.config.js
RENAMED
File without changes
|
index.html β frond/index.html
RENAMED
File without changes
|
package.json β frond/package.json
RENAMED
File without changes
|
{public β frond/public}/vite.svg
RENAMED
File without changes
|
{src β frond/src}/contacts.js
RENAMED
File without changes
|
{src β frond/src}/error-page.jsx
RENAMED
File without changes
|
{src β frond/src}/index.css
RENAMED
File without changes
|
{src β frond/src}/main.jsx
RENAMED
File without changes
|
{src β frond/src}/providers/AuthProvider.jsx
RENAMED
File without changes
|
{src β frond/src}/routes/contact.jsx
RENAMED
File without changes
|
{src β frond/src}/routes/destroy.jsx
RENAMED
File without changes
|
{src β frond/src}/routes/edit.jsx
RENAMED
File without changes
|
{src β frond/src}/routes/index.jsx
RENAMED
File without changes
|
{src β frond/src}/routes/root.jsx
RENAMED
File without changes
|
vite.config.js β frond/vite.config.js
RENAMED
File without changes
|
mocos.js
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
import * as http from "http";
|
2 |
-
const server = http.createServer();
|
3 |
-
const PORT = 7860;
|
4 |
-
const HOST = "chartmand-testing-area.hf.space";
|
5 |
-
|
6 |
-
server.listen(PORT, HOST, () => {
|
7 |
-
console.log(`Server is running on http://${HOST}:${PORT}`);
|
8 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package-lock.json
DELETED
The diff for this file is too large to render.
See raw diff
|
|