프로젝트
GitHub에서 보기
micmro/Stylify-Me
소개
Website style analyzer for designers. This is the service part that does the analyzation etc.
학습 및 교육측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalStylify Me
A Style Guide Generator - using NodeJS and Puppeteer, an API to control Chrome. See it live at http://stylifyme.com
This repo only contains the web service.
Deployment
We host our app on EC2
Example installation steps on an Ubuntu image:
# install chromium
sudo apt-get update
sudo apt-get install -y libappindicator1 fonts-liberation
sudo apt-get install -y chromium-browser
# install node 20
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
#install puppeteer
sudo apt-get install -y gcc g++ make
sudo npm install -g puppeteer
# download and unzip repo
wget https://github.com/micmro/Stylify-Me/archive/main.tar.gz
tar -xzvf ./main.tar.gz
rm main.tar.gz
mv Stylify-Me-main stylifyme
cd stylifyme/
#install dependencies and start on port 80
npm ci
sudo PORT=80 npm run start
Running the service locally
- Make sure you have NodeJS installed and running
- Install dependencies with npm
npm install - Update the referrer urls in
/src/config.mjswith the urls of your frontend (local and production): - Start the nodeJs app with
npm run start(ornode app.mjs) - Query
http://localhost:5000/query?url=https%3A%2F%2Fgoogle.com(assuming you run your app on port5000) and you should be able to see a JSON response I recommend using Postman for debugging your api
Frontend
This repo only contains the web service, you can query it from the front end like this:
var urlToQuery = encodeURIComponent("http://google.com");
$.ajax({
dataType: "jsonp",
url: "http://youreServiceUrl.com/query?url="+ urlToQuery,
success: function(data){
if(data["error"]){
alert("Error: " + data["error"]);
return;
}
//PROCESS the result
},
timeout : 10000
}).fail(function(){
alert("Could not query site, the service might be down, please try again later.");
});
관련 프로젝트 살펴보기
불러오는 중…