This is a solution to the Shortly URL shortening API Challenge challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout for the site depending on their device's screen size
- Shorten any valid URL
- See a list of their shortened links, even after refreshing the browser
- Copy the shortened link to their clipboard in a single click
- Receive an error message when the
form
is submitted if:- The
input
field is empty
- The
- Solution URL: Front End Mentor
- Live Site URL: Vercel
- Flexbox
- Mobile-first workflow
- React - JS library
- Create React App - Setup
- Axios - HTTP Client
- Styled Components - For styles
// react with jsx
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(<h1>Hello, world!</h1>);
// axios with async/await
async function getData() {
try {
const response = await axios.get("url");
console.log(response);
} catch (error) {
console.error(error);
}
}
// styled-components
const Button = styled.button`
background-color: hsl(180, 66%, 49%);
`;
- Website - El Bhiruni
- Frontend Mentor - @elbhiruni